summaryrefslogtreecommitdiff
path: root/src/main/webapp/jquery-ui-1.9pre/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/jquery-ui-1.9pre/tests')
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/index.html22
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js8936
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js8981
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js9044
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js9046
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.js8865
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js9266
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.js9300
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery.js26
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js234
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js39
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html161
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html1367
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html86
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html246
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html17
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/static.css1
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/static/static.js9
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html144
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js55
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js20
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js28
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html142
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js338
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js122
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js40
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js283
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html72
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html51
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js83
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js25
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js179
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js193
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt1
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt1
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt1
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html71
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js84
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js14
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js8
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js19
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js93
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js59
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html134
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js157
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js239
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html60
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js449
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js9
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js127
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js121
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js925
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js84
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html60
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js138
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js34
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js254
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js127
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js444
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js143
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html60
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js67
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js36
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js81
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js99
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js753
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html60
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js36
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js16
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js28
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js86
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js68
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html117
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js182
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js68
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.pngbin0 -> 1193 bytes
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html96
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html258
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js41
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js14
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js431
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js15
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js10
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js14
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html75
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js547
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js545
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html68
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js32
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html46
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js28
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js10
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js51
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js36
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js59
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpgbin0 -> 391 bytes
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html58
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js148
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js28
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js20
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js64
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js190
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html63
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js16
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js16
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js32
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js93
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js46
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html60
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js292
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js19
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js109
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js102
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js146
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html64
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js9
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js34
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js147
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js108
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js256
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js83
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html52
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js206
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js19
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js221
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js164
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js190
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js5
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js21
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css8
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js82
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js9
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html1
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html181
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js94
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js16
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js29
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html180
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js576
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js277
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js237
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js213
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js105
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html51
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js26
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js20
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js83
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js67
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js73
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html30
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html46
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js257
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js1069
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js103
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html50
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html140
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html84
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html555
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html55
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html42
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html58
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html202
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html86
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html157
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html65
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html109
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html108
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html73
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html37
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html229
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html2963
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css55
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html217
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js106
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html159
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html266
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html283
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html67
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html67
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html148
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html77
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html86
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html43
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html200
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html532
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php2
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html72
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html213
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html186
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css3
220 files changed, 90902 insertions, 0 deletions
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/index.html b/src/main/webapp/jquery-ui-1.9pre/tests/index.html
new file mode 100644
index 0000000..710c726
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/index.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery UI Tests</title>
+ <link rel="stylesheet" href="../themes/base/jquery.ui.all.css" type="text/css" />
+ <script type="text/javascript" src="../jquery-1.7.1.js"></script>
+ <link rel="stylesheet" href="tests.css" type="text/css" />
+ <script type="text/javascript" src="tests.js"></script>
+</head>
+<body>
+
+<h1>jQuery UI Tests</h1>
+
+<h2><a href="static/index.html">Static Tests</a></h2>
+
+<h2><a href="unit/index.html">Unit Tests</a></h2>
+
+<h2><a href="visual/index.html">Visual Tests</a></h2>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js
new file mode 100644
index 0000000..5d5a1d5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js
@@ -0,0 +1,8936 @@
+/*!
+ * jQuery JavaScript Library v1.6.1
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu May 12 15:04:36 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.6.1",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery._Deferred();
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return (new Function( "return " + data ))();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ // (xml & tmp used internally)
+ parseXML: function( data , xml , tmp ) {
+
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+
+ tmp = xml.documentElement;
+
+ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+
+ if ( indexOf ) {
+ return indexOf.call( array, elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can be optionally by executed if its a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+// Expose jQuery to the global object
+return jQuery;
+
+})();
+
+
+var // Promise methods
+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+ // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+ // Create a simple deferred (one callbacks list)
+ _Deferred: function() {
+ var // callbacks list
+ callbacks = [],
+ // stored [ context , args ]
+ fired,
+ // to avoid firing when already doing so
+ firing,
+ // flag to know if the deferred has been cancelled
+ cancelled,
+ // the deferred itself
+ deferred = {
+
+ // done( f1, f2, ...)
+ done: function() {
+ if ( !cancelled ) {
+ var args = arguments,
+ i,
+ length,
+ elem,
+ type,
+ _fired;
+ if ( fired ) {
+ _fired = fired;
+ fired = 0;
+ }
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ deferred.done.apply( deferred, elem );
+ } else if ( type === "function" ) {
+ callbacks.push( elem );
+ }
+ }
+ if ( _fired ) {
+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+ }
+ }
+ return this;
+ },
+
+ // resolve with given context and args
+ resolveWith: function( context, args ) {
+ if ( !cancelled && !fired && !firing ) {
+ // make sure args are available (#8421)
+ args = args || [];
+ firing = 1;
+ try {
+ while( callbacks[ 0 ] ) {
+ callbacks.shift().apply( context, args );
+ }
+ }
+ finally {
+ fired = [ context, args ];
+ firing = 0;
+ }
+ }
+ return this;
+ },
+
+ // resolve with this as context and given arguments
+ resolve: function() {
+ deferred.resolveWith( this, arguments );
+ return this;
+ },
+
+ // Has this deferred been resolved?
+ isResolved: function() {
+ return !!( firing || fired );
+ },
+
+ // Cancel
+ cancel: function() {
+ cancelled = 1;
+ callbacks = [];
+ return this;
+ }
+ };
+
+ return deferred;
+ },
+
+ // Full fledged deferred (two callbacks list)
+ Deferred: function( func ) {
+ var deferred = jQuery._Deferred(),
+ failDeferred = jQuery._Deferred(),
+ promise;
+ // Add errorDeferred methods, then and promise
+ jQuery.extend( deferred, {
+ then: function( doneCallbacks, failCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+ },
+ fail: failDeferred.done,
+ rejectWith: failDeferred.resolveWith,
+ reject: failDeferred.resolve,
+ isRejected: failDeferred.isResolved,
+ pipe: function( fnDone, fnFail ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject );
+ } else {
+ newDefer[ action ]( returned );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ if ( promise ) {
+ return promise;
+ }
+ promise = obj = {};
+ }
+ var i = promiseMethods.length;
+ while( i-- ) {
+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+ }
+ return obj;
+ }
+ });
+ // Make sure only one callback list will be used
+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+ // Unexpose cancel
+ delete deferred.cancel;
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = arguments,
+ i = 0,
+ length = args.length,
+ count = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ // Strange bug in FF4:
+ // Values changed onto the arguments object sometimes end up as undefined values
+ // outside the $.when method. Cloning the object into a fresh array solves the issue
+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+ }
+ };
+ }
+ if ( length > 1 ) {
+ for( ; i < length; i++ ) {
+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return deferred.promise();
+ }
+});
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ bodyStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ div.detachEvent( "onclick", click );
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains it's value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ // We use our own, invisible, body
+ body = document.createElement( "body" );
+ bodyStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ // Set background to avoid IE crashes when removing (#9028)
+ background: "none"
+ };
+ for ( i in bodyStyle ) {
+ body.style[ i ] = bodyStyle[ i ];
+ }
+ body.appendChild( div );
+ documentElement.insertBefore( body, documentElement.firstChild );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Remove the body element we added
+ body.innerHTML = "";
+ documentElement.removeChild( body );
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([a-z])([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+ } else {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // Internal jQuery data is stored in a separate object inside the object's data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data
+ if ( pvt ) {
+ if ( !thisCache[ internalKey ] ) {
+ thisCache[ internalKey ] = {};
+ }
+
+ thisCache = thisCache[ internalKey ];
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+ // not attempt to inspect the internal events object using jQuery.data, as this
+ // internal data object is undocumented and subject to change.
+ if ( name === "events" && !thisCache[name] ) {
+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+ }
+
+ return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+ var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
+ if ( thisCache ) {
+ delete thisCache[ name ];
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !isEmptyDataObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( pvt ) {
+ delete cache[ id ][ internalKey ];
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ var internalCache = cache[ id ][ internalKey ];
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ if ( jQuery.support.deleteExpando || cache != window ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the entire user cache at once because it's faster than
+ // iterating through each key, but we need to continue to persist internal
+ // data if it existed
+ if ( internalCache ) {
+ cache[ id ] = {};
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+
+ cache[ id ][ internalKey ] = internalCache;
+
+ // Otherwise, we need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ } else if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 ) {
+ var attr = this[0].attributes, name;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery.data( elem, deferDataKey, undefined, true );
+ if ( defer &&
+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.resolve();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = (type || "fx") + "mark";
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+ if ( count ) {
+ jQuery.data( elem, key, count, true );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ if ( elem ) {
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type, undefined, true );
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ defer;
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+ count++;
+ tmp.done( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ rinvalidChar = /\:/,
+ formHook, boolHook;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class") || "") );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ",
+ setClass = elem.className;
+
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ setClass += " " + classNames[c];
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ return (elem.value || "").replace(rreturn, "");
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attrFix: {
+ // Always normalize to ensure hook usage
+ tabindex: "tabIndex"
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Normalize the name if needed
+ name = notxml && jQuery.attrFix[ name ] || name;
+
+ hooks = jQuery.attrHooks[ name ];
+
+ if ( !hooks ) {
+ // Use boolHook for boolean attributes
+ if ( rboolean.test( name ) &&
+ (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) {
+
+ hooks = boolHook;
+
+ // Use formHook for forms and if the name contains certain characters
+ } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+ hooks = formHook;
+ }
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml ) {
+ return hooks.get( elem, name );
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, name ) {
+ var propName;
+ if ( elem.nodeType === 1 ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ if ( jQuery.support.getSetAttribute ) {
+ // Use removeAttribute in browsers that support it
+ elem.removeAttribute( name );
+ } else {
+ jQuery.attr( elem, name, "" );
+ elem.removeAttributeNode( elem.getAttributeNode( name ) );
+ }
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabIndex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.propFix[ name ] || name;
+
+ hooks = jQuery.propHooks[ name ];
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return (elem[ name ] = value);
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {}
+});
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ return elem[ jQuery.propFix[ name ] || name ] ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = value;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// Use the value property for back compat
+// Use the formHook for button elements in IE6/7 (#1954)
+jQuery.attrHooks.value = {
+ get: function( elem, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.get( elem, name );
+ }
+ return elem.value;
+ },
+ set: function( elem, value, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+
+ // propFix is more comprehensive and contains all fixes
+ jQuery.attrFix = jQuery.propFix;
+
+ // Use this for any attribute on a form in IE6/7
+ formHook = jQuery.attrHooks.name = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ // Return undefined if nodeValue is empty string
+ return ret && ret.nodeValue !== "" ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Check form objects in IE (multiple bugs related)
+ // Only use nodeValue if the attribute node exists on the form
+ var ret = elem.getAttributeNode( name );
+ if ( ret ) {
+ ret.nodeValue = value;
+ return value;
+ }
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return (elem.style.cssText = "" + value);
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+ });
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
+ }
+ }
+ });
+});
+
+
+
+
+var hasOwn = Object.prototype.hasOwnProperty,
+ rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ } else if ( !handler ) {
+ // Fixes bug #7229. Fix recommended by jdalton
+ return;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery._data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events,
+ eventHandle = elemData.handle;
+
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem, undefined, true );
+ }
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ exclusive;
+
+ if ( type.indexOf("!") >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ jQuery.each( jQuery.cache, function() {
+ // internalKey variable is just used to make it easier to find
+ // and potentially change this stuff later; currently it just
+ // points to jQuery.expando
+ var internalKey = jQuery.expando,
+ internalCache = this[ internalKey ];
+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+ jQuery.event.trigger( event, data, internalCache.handle.elem );
+ }
+ });
+ return;
+ }
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ var cur = elem,
+ // IE doesn't like method names with a colon (#3533, #8272)
+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+ // Fire event on the current element, then bubble up the DOM tree
+ do {
+ var handle = jQuery._data( cur, "handle" );
+
+ event.currentTarget = cur;
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Trigger an inline bound script
+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+
+ // Bubble up to document, then to window
+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+ } while ( cur && !event.isPropagationStopped() );
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+ var old,
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+ try {
+ if ( ontype && elem[ type ] ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ }
+ } catch ( ieError ) {}
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+
+ jQuery.event.triggered = undefined;
+ }
+ }
+
+ return event.result;
+ },
+
+ handle: function( event ) {
+ event = jQuery.event.fix( event || window.event );
+ // Snapshot the handlers list since a called handler may add/remove events.
+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+ run_all = !event.exclusive && !event.namespace,
+ args = Array.prototype.slice.call( arguments, 0 );
+
+ // Use the fix-ed Event rather than the (read-only) native event
+ args[0] = event;
+ event.currentTarget = this;
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Triggered event must 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event.
+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ return event.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( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ // Fixes #1925 where srcElement might not be defined either
+ event.target = event.srcElement || document;
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var eventDocument = event.target.ownerDocument || document,
+ doc = eventDocument.documentElement,
+ body = eventDocument.body;
+
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // set the correct event type
+ event.type = event.data;
+
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+
+ // Chrome does something similar, the parentNode property
+ // can be accessed but is null.
+ if ( parent && parent !== document && !parent.parentNode ) {
+ return;
+ }
+
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ parent = parent.parentNode;
+ }
+
+ if ( parent !== this ) {
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) { }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( !jQuery.nodeName( this, "form" ) ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( jQuery.nodeName( elem, "select" ) ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery._data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery._data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery._data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ // Don't pass args or remember liveFired; they apply to the donor event.
+ var event = jQuery.extend( {}, args[ 0 ] );
+ event.type = type;
+ event.originalEvent = {};
+ event.liveFired = undefined;
+ jQuery.event.handle.call( elem, event );
+ if ( event.isDefaultPrevented() ) {
+ args[ 0 ].preventDefault();
+ }
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0;
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( donor ) {
+ // Donor event is always a native one; fix it and switch its type.
+ // Let focusin/out handler cancel the donor focus/blur event.
+ var e = jQuery.event.fix( donor );
+ e.type = fix;
+ e.originalEvent = {};
+ jQuery.event.trigger( e, null, e.target );
+ if ( e.isDefaultPrevented() ) {
+ donor.preventDefault();
+ }
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ var handler;
+
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( arguments.length === 2 || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ if ( name === "one" ) {
+ handler = function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ };
+ handler.guid = fn.guid || jQuery.guid++;
+ } else {
+ handler = fn;
+ }
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( name === "die" && !types &&
+ origSelector && origSelector.charAt(0) === "." ) {
+
+ context.unbind( origSelector );
+
+ return this;
+ }
+
+ if ( data === false || jQuery.isFunction( data ) ) {
+ fn = data || returnFalse;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( liveMap[ type ] ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
+ events = jQuery._data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+ // Make sure not to accidentally match a child element with the same selector
+ if ( related && jQuery.contains( elem, related ) ) {
+ related = elem;
+ }
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
+}
+
+jQuery.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( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var match,
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var found, item,
+ filter = Expr.filter[ type ],
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ var first = match[2],
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && ( typeof selector === "string" ?
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array
+ if ( jQuery.isArray( selectors ) ) {
+ var match, selector,
+ matches = {},
+ level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[ selector ] ) {
+ matches[ selector ] = POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[ selector ];
+
+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || (l > 1 && i < lastIndex) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando,
+ oldData = jQuery.data( src ),
+ curData = jQuery.data( dest, oldData );
+
+ // Switch to use the internal data object, if it exists, for the next
+ // stage of data copying
+ if ( (oldData = oldData[ internalKey ]) ) {
+ var events = oldData.events;
+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults,
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( "getElementsByTagName" in elem ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( "querySelectorAll" in elem ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( elem.getElementsByTagName ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ] && cache[ id ][ internalKey ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ rdashAlpha = /-([a-z])/ig,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^[+\-]=/,
+ rrelNumFilter = /[^+\-\.\de]+/g,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle,
+
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "zIndex": true,
+ "fontWeight": true,
+ "opacity": true,
+ "zoom": true,
+ "lineHeight": true,
+ "widows": true,
+ "orphans": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( type === "number" && isNaN( value ) || value == null ) {
+ return;
+ }
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && rrelNum.test( value ) ) {
+ value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ },
+
+ camelCase: function( string ) {
+ return string.replace( rdashAlpha, fcamelCase );
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ val = getWH( elem, name, extra );
+
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ if ( val <= 0 ) {
+ val = curCSS( elem, name, name );
+
+ if ( val === "0px" && currentStyle ) {
+ val = currentStyle( elem, name, name );
+ }
+
+ if ( val != null ) {
+ // Should return "auto" instead of 0, use 0 for
+ // temporary backwards-compat
+ return val === "" || val === "auto" ? "0px" : val;
+ }
+ }
+
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+
+ // Should return "auto" instead of 0, use 0 for
+ // temporary backwards-compat
+ return val === "" || val === "auto" ? "0px" : val;
+ }
+
+ return typeof val === "string" ? val : val + "px";
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat(value);
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle;
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = jQuery.isNaN( value ) ?
+ "" :
+ "alpha(opacity=" + value * 100 + ")",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+ style = elem.style;
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ left = style.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+ var which = name === "width" ? cssWidth : cssHeight,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return val;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
+
+ } else {
+ val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
+ }
+ });
+
+ return val;
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts;
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for(; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function ( target, settings ) {
+ if ( !settings ) {
+ // Only one parameter, we extend ajaxSettings
+ settings = target;
+ target = jQuery.extend( true, jQuery.ajaxSettings, settings );
+ } else {
+ // target was provided, we extend into it
+ jQuery.extend( true, target, jQuery.ajaxSettings, settings );
+ }
+ // Flatten fields we don't want deep extended
+ for( var field in { context: 1, url: 1 } ) {
+ if ( field in settings ) {
+ target[ field ] = settings[ field ];
+ } else if( field in jQuery.ajaxSettings ) {
+ target[ field ] = jQuery.ajaxSettings[ field ];
+ }
+ }
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ 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"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery._Deferred(),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, statusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = statusText;
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.done;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( status < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for( key in s.converters ) {
+ if( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow,
+ requestAnimationFrame = window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ if ( this[i].style ) {
+ var display = jQuery.css( this[i], "display" );
+
+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+ jQuery._data( this[i], "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p,
+ display, e,
+ parts, start, end, unit;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height
+ // animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+ if ( !jQuery.support.inlineBlockNeedsLayout ) {
+ this.style.display = "inline-block";
+
+ } else {
+ display = defaultDisplay( this.nodeName );
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( display === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.display = "inline";
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ((end || 1) / e.cur()) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+ while ( i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function( noUnmark ) {
+ if ( opt.queue !== false ) {
+ jQuery.dequeue( this );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx,
+ raf;
+
+ this.startTime = fxNow || createFxNow();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ // Use requestAnimationFrame instead of setInterval if available
+ if ( requestAnimationFrame ) {
+ timerId = 1;
+ raf = function() {
+ // When timerId gets set to null at any point, this stops
+ if ( timerId ) {
+ requestAnimationFrame( raf );
+ fx.tick();
+ }
+ };
+ requestAnimationFrame( raf );
+ } else {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options,
+ i, n;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( i in options.animatedProperties ) {
+ if ( options.animatedProperties[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function (index, value) {
+ elem.style[ "overflow" + value ] = options.overflow[index];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery(elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( var p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[p] );
+ }
+ }
+
+ // Execute the complete function
+ options.complete.call( elem );
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var elem = jQuery( "<" + nodeName + ">" ).appendTo( "body" ),
+ display = elem.css( "display" );
+
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ document.body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake html
+ // document to it, Webkit & Firefox won't allow reusing the iframe document
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( "<!doctype><html><body></body></html>" );
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+
+ document.body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
+ html = "<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>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed";
+ checkDiv.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden";
+ innerDiv.style.position = "relative";
+
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if (options.top != null) {
+ props.top = (options.top - curOffset.top) + curTop;
+ }
+ if (options.left != null) {
+ props.left = (options.left - curOffset.left) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ parseFloat( jQuery.css( this[0], type, "padding" ) ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ];
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ elem.document.body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNaN( ret ) ? orig : ret;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+window.jQuery = window.$ = jQuery;
+})(window);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js
new file mode 100644
index 0000000..f3201aa
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js
@@ -0,0 +1,8981 @@
+/*!
+ * jQuery JavaScript Library v1.6.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Jun 30 14:16:56 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z])/ig,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.6.2",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery._Deferred();
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return (new Function( "return " + data ))();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ // (xml & tmp used internally)
+ parseXML: function( data , xml , tmp ) {
+
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+
+ tmp = xml.documentElement;
+
+ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Converts a dashed string to camelCased string;
+ // Used by both the css and data modules
+ camelCase: function( string ) {
+ return string.replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+
+ if ( indexOf ) {
+ return indexOf.call( array, elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+var // Promise methods
+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+ // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+ // Create a simple deferred (one callbacks list)
+ _Deferred: function() {
+ var // callbacks list
+ callbacks = [],
+ // stored [ context , args ]
+ fired,
+ // to avoid firing when already doing so
+ firing,
+ // flag to know if the deferred has been cancelled
+ cancelled,
+ // the deferred itself
+ deferred = {
+
+ // done( f1, f2, ...)
+ done: function() {
+ if ( !cancelled ) {
+ var args = arguments,
+ i,
+ length,
+ elem,
+ type,
+ _fired;
+ if ( fired ) {
+ _fired = fired;
+ fired = 0;
+ }
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ deferred.done.apply( deferred, elem );
+ } else if ( type === "function" ) {
+ callbacks.push( elem );
+ }
+ }
+ if ( _fired ) {
+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+ }
+ }
+ return this;
+ },
+
+ // resolve with given context and args
+ resolveWith: function( context, args ) {
+ if ( !cancelled && !fired && !firing ) {
+ // make sure args are available (#8421)
+ args = args || [];
+ firing = 1;
+ try {
+ while( callbacks[ 0 ] ) {
+ callbacks.shift().apply( context, args );
+ }
+ }
+ finally {
+ fired = [ context, args ];
+ firing = 0;
+ }
+ }
+ return this;
+ },
+
+ // resolve with this as context and given arguments
+ resolve: function() {
+ deferred.resolveWith( this, arguments );
+ return this;
+ },
+
+ // Has this deferred been resolved?
+ isResolved: function() {
+ return !!( firing || fired );
+ },
+
+ // Cancel
+ cancel: function() {
+ cancelled = 1;
+ callbacks = [];
+ return this;
+ }
+ };
+
+ return deferred;
+ },
+
+ // Full fledged deferred (two callbacks list)
+ Deferred: function( func ) {
+ var deferred = jQuery._Deferred(),
+ failDeferred = jQuery._Deferred(),
+ promise;
+ // Add errorDeferred methods, then and promise
+ jQuery.extend( deferred, {
+ then: function( doneCallbacks, failCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+ },
+ fail: failDeferred.done,
+ rejectWith: failDeferred.resolveWith,
+ reject: failDeferred.resolve,
+ isRejected: failDeferred.isResolved,
+ pipe: function( fnDone, fnFail ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject );
+ } else {
+ newDefer[ action ]( returned );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ if ( promise ) {
+ return promise;
+ }
+ promise = obj = {};
+ }
+ var i = promiseMethods.length;
+ while( i-- ) {
+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+ }
+ return obj;
+ }
+ });
+ // Make sure only one callback list will be used
+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+ // Unexpose cancel
+ delete deferred.cancel;
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = arguments,
+ i = 0,
+ length = args.length,
+ count = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ // Strange bug in FF4:
+ // Values changed onto the arguments object sometimes end up as undefined values
+ // outside the $.when method. Cloning the object into a fresh array solves the issue
+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+ }
+ };
+ }
+ if ( length > 1 ) {
+ for( ; i < length; i++ ) {
+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return deferred.promise();
+ }
+});
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ testElementParent,
+ testElement,
+ testElementStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains it's value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ // We use our own, invisible, body unless the body is already present
+ // in which case we use a div (#9239)
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0
+ };
+ if ( body ) {
+ jQuery.extend( testElementStyle, {
+ position: "absolute",
+ left: -1000,
+ top: -1000
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Remove the body element we added
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ // Null connected elements to avoid leaks in IE
+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([a-z])([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+ } else {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // Internal jQuery data is stored in a separate object inside the object's data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data
+ if ( pvt ) {
+ if ( !thisCache[ internalKey ] ) {
+ thisCache[ internalKey ] = {};
+ }
+
+ thisCache = thisCache[ internalKey ];
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+ // not attempt to inspect the internal events object using jQuery.data, as this
+ // internal data object is undocumented and subject to change.
+ if ( name === "events" && !thisCache[name] ) {
+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+ }
+
+ return getByName ?
+ // Check for both converted-to-camel and non-converted data property names
+ thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
+ thisCache;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+ var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
+ if ( thisCache ) {
+ delete thisCache[ name ];
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !isEmptyDataObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( pvt ) {
+ delete cache[ id ][ internalKey ];
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ var internalCache = cache[ id ][ internalKey ];
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ if ( jQuery.support.deleteExpando || cache != window ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the entire user cache at once because it's faster than
+ // iterating through each key, but we need to continue to persist internal
+ // data if it existed
+ if ( internalCache ) {
+ cache[ id ] = {};
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+
+ cache[ id ][ internalKey ] = internalCache;
+
+ // Otherwise, we need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ } else if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 ) {
+ var attr = this[0].attributes, name;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery.data( elem, deferDataKey, undefined, true );
+ if ( defer &&
+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.resolve();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = (type || "fx") + "mark";
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+ if ( count ) {
+ jQuery.data( elem, key, count, true );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ if ( elem ) {
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type, undefined, true );
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ defer;
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+ count++;
+ tmp.done( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ rinvalidChar = /\:|^on/,
+ formHook, boolHook;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = (value || "").split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attrFix: {
+ // Always normalize to ensure hook usage
+ tabindex: "tabIndex"
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Normalize the name if needed
+ if ( notxml ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ hooks = jQuery.attrHooks[ name ];
+
+ if ( !hooks ) {
+ // Use boolHook for boolean attributes
+ if ( rboolean.test( name ) ) {
+
+ hooks = boolHook;
+
+ // Use formHook for forms and if the name contains certain characters
+ } else if ( formHook && name !== "className" &&
+ (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+
+ hooks = formHook;
+ }
+ }
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, name ) {
+ var propName;
+ if ( elem.nodeType === 1 ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ if ( jQuery.support.getSetAttribute ) {
+ // Use removeAttribute in browsers that support it
+ elem.removeAttribute( name );
+ } else {
+ jQuery.attr( elem, name, "" );
+ elem.removeAttributeNode( elem.getAttributeNode( name ) );
+ }
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabIndex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ },
+ // Use the value property for back compat
+ // Use the formHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return (elem[ name ] = value);
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {}
+});
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ return jQuery.prop( elem, name ) ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+
+ // propFix is more comprehensive and contains all fixes
+ jQuery.attrFix = jQuery.propFix;
+
+ // Use this for any attribute on a form in IE6/7
+ formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ // Return undefined if nodeValue is empty string
+ return ret && ret.nodeValue !== "" ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Check form objects in IE (multiple bugs related)
+ // Only use nodeValue if the attribute node exists on the form
+ var ret = elem.getAttributeNode( name );
+ if ( ret ) {
+ ret.nodeValue = value;
+ return value;
+ }
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return (elem.style.cssText = "" + value);
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+ });
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
+ }
+ }
+ });
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ } else if ( !handler ) {
+ // Fixes bug #7229. Fix recommended by jdalton
+ return;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery._data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events,
+ eventHandle = elemData.handle;
+
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem, undefined, true );
+ }
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ exclusive;
+
+ if ( type.indexOf("!") >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ jQuery.each( jQuery.cache, function() {
+ // internalKey variable is just used to make it easier to find
+ // and potentially change this stuff later; currently it just
+ // points to jQuery.expando
+ var internalKey = jQuery.expando,
+ internalCache = this[ internalKey ];
+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+ jQuery.event.trigger( event, data, internalCache.handle.elem );
+ }
+ });
+ return;
+ }
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ var cur = elem,
+ // IE doesn't like method names with a colon (#3533, #8272)
+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+ // Fire event on the current element, then bubble up the DOM tree
+ do {
+ var handle = jQuery._data( cur, "handle" );
+
+ event.currentTarget = cur;
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Trigger an inline bound script
+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+
+ // Bubble up to document, then to window
+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+ } while ( cur && !event.isPropagationStopped() );
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+ var old,
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+ try {
+ if ( ontype && elem[ type ] ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ }
+ } catch ( ieError ) {}
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+
+ jQuery.event.triggered = undefined;
+ }
+ }
+
+ return event.result;
+ },
+
+ handle: function( event ) {
+ event = jQuery.event.fix( event || window.event );
+ // Snapshot the handlers list since a called handler may add/remove events.
+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+ run_all = !event.exclusive && !event.namespace,
+ args = Array.prototype.slice.call( arguments, 0 );
+
+ // Use the fix-ed Event rather than the (read-only) native event
+ args[0] = event;
+ event.currentTarget = this;
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Triggered event must 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event.
+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ return event.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( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ // Fixes #1925 where srcElement might not be defined either
+ event.target = event.srcElement || document;
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var eventDocument = event.target.ownerDocument || document,
+ doc = eventDocument.documentElement,
+ body = eventDocument.body;
+
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+
+ // Check if mouse(over|out) are still within the same parent element
+ var related = event.relatedTarget,
+ inside = false,
+ eventType = event.type;
+
+ event.type = event.data;
+
+ if ( related !== this ) {
+
+ if ( related ) {
+ inside = jQuery.contains( this, related );
+ }
+
+ if ( !inside ) {
+
+ jQuery.event.handle.apply( this, arguments );
+
+ event.type = eventType;
+ }
+ }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( !jQuery.nodeName( this, "form" ) ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( jQuery.nodeName( elem, "select" ) ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery._data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery._data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery._data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ // Don't pass args or remember liveFired; they apply to the donor event.
+ var event = jQuery.extend( {}, args[ 0 ] );
+ event.type = type;
+ event.originalEvent = {};
+ event.liveFired = undefined;
+ jQuery.event.handle.call( elem, event );
+ if ( event.isDefaultPrevented() ) {
+ args[ 0 ].preventDefault();
+ }
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0;
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( donor ) {
+ // Donor event is always a native one; fix it and switch its type.
+ // Let focusin/out handler cancel the donor focus/blur event.
+ var e = jQuery.event.fix( donor );
+ e.type = fix;
+ e.originalEvent = {};
+ jQuery.event.trigger( e, null, e.target );
+ if ( e.isDefaultPrevented() ) {
+ donor.preventDefault();
+ }
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ var handler;
+
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( arguments.length === 2 || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ if ( name === "one" ) {
+ handler = function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ };
+ handler.guid = fn.guid || jQuery.guid++;
+ } else {
+ handler = fn;
+ }
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( name === "die" && !types &&
+ origSelector && origSelector.charAt(0) === "." ) {
+
+ context.unbind( origSelector );
+
+ return this;
+ }
+
+ if ( data === false || jQuery.isFunction( data ) ) {
+ fn = data || returnFalse;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( liveMap[ type ] ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
+ events = jQuery._data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+ // Make sure not to accidentally match a child element with the same selector
+ if ( related && jQuery.contains( elem, related ) ) {
+ related = elem;
+ }
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
+}
+
+jQuery.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( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var match,
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var found, item,
+ filter = Expr.filter[ type ],
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ var first = match[2],
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && ( typeof selector === "string" ?
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array
+ if ( jQuery.isArray( selectors ) ) {
+ var match, selector,
+ matches = {},
+ level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[ selector ] ) {
+ matches[ selector ] = POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[ selector ];
+
+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || (l > 1 && i < lastIndex) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando,
+ oldData = jQuery.data( src ),
+ curData = jQuery.data( dest, oldData );
+
+ // Switch to use the internal data object, if it exists, for the next
+ // stage of data copying
+ if ( (oldData = oldData[ internalKey ]) ) {
+ var events = oldData.events;
+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc;
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( "getElementsByTagName" in elem ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( "querySelectorAll" in elem ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( "getElementsByTagName" in elem ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ] && cache[ id ][ internalKey ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^[+\-]=/,
+ rrelNumFilter = /[^+\-\.\de]+/g,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( type === "number" && isNaN( value ) || value == null ) {
+ return;
+ }
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && rrelNum.test( value ) ) {
+ value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWH( elem, name, extra );
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ return val;
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat( value );
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle;
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = jQuery.isNaN( value ) ?
+ "" :
+ "alpha(opacity=" + value * 100 + ")",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+ style = elem.style;
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ left = style.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ which = name === "width" ? cssWidth : cssHeight;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ] || 0;
+ }
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ jQuery.each( which, function() {
+ val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts;
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for(; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function ( target, settings ) {
+ if ( !settings ) {
+ // Only one parameter, we extend ajaxSettings
+ settings = target;
+ target = jQuery.extend( true, jQuery.ajaxSettings, settings );
+ } else {
+ // target was provided, we extend into it
+ jQuery.extend( true, target, jQuery.ajaxSettings, settings );
+ }
+ // Flatten fields we don't want deep extended
+ for( var field in { context: 1, url: 1 } ) {
+ if ( field in settings ) {
+ target[ field ] = settings[ field ];
+ } else if( field in jQuery.ajaxSettings ) {
+ target[ field ] = jQuery.ajaxSettings[ field ];
+ }
+ }
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ 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"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery._Deferred(),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, statusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = statusText;
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.done;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( status < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for( key in s.converters ) {
+ if( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow,
+ requestAnimationFrame = window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ if ( this[i].style ) {
+ var display = jQuery.css( this[i], "display" );
+
+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+ jQuery._data( this[i], "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p,
+ display, e,
+ parts, start, end, unit;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height
+ // animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+ if ( !jQuery.support.inlineBlockNeedsLayout ) {
+ this.style.display = "inline-block";
+
+ } else {
+ display = defaultDisplay( this.nodeName );
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( display === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.display = "inline";
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ((end || 1) / e.cur()) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+ while ( i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue !== false ) {
+ jQuery.dequeue( this );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx,
+ raf;
+
+ this.startTime = fxNow || createFxNow();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ // Use requestAnimationFrame instead of setInterval if available
+ if ( requestAnimationFrame ) {
+ timerId = true;
+ raf = function() {
+ // When timerId gets set to null at any point, this stops
+ if ( timerId ) {
+ requestAnimationFrame( raf );
+ fx.tick();
+ }
+ };
+ requestAnimationFrame( raf );
+ } else {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options,
+ i, n;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( i in options.animatedProperties ) {
+ if ( options.animatedProperties[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function (index, value) {
+ elem.style[ "overflow" + value ] = options.overflow[index];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery(elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( var p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[p] );
+ }
+ }
+
+ // Execute the complete function
+ options.complete.call( elem );
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
+ html = "<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>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed";
+ checkDiv.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden";
+ innerDiv.style.position = "relative";
+
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if (options.top != null) {
+ props.top = (options.top - curOffset.top) + curTop;
+ }
+ if (options.left != null) {
+ props.left = (options.left - curOffset.left) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ];
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ elem.document.body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNaN( ret ) ? orig : ret;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+})(window);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js
new file mode 100644
index 0000000..792e62f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js
@@ -0,0 +1,9044 @@
+/*!
+ * jQuery JavaScript Library v1.6.3
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Aug 31 10:35:15 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.6.3",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery._Deferred();
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return (new Function( "return " + data ))();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( !array ) {
+ return -1;
+ }
+
+ if ( indexOf ) {
+ return indexOf.call( array, elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+var // Promise methods
+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+ // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+ // Create a simple deferred (one callbacks list)
+ _Deferred: function() {
+ var // callbacks list
+ callbacks = [],
+ // stored [ context , args ]
+ fired,
+ // to avoid firing when already doing so
+ firing,
+ // flag to know if the deferred has been cancelled
+ cancelled,
+ // the deferred itself
+ deferred = {
+
+ // done( f1, f2, ...)
+ done: function() {
+ if ( !cancelled ) {
+ var args = arguments,
+ i,
+ length,
+ elem,
+ type,
+ _fired;
+ if ( fired ) {
+ _fired = fired;
+ fired = 0;
+ }
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ deferred.done.apply( deferred, elem );
+ } else if ( type === "function" ) {
+ callbacks.push( elem );
+ }
+ }
+ if ( _fired ) {
+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+ }
+ }
+ return this;
+ },
+
+ // resolve with given context and args
+ resolveWith: function( context, args ) {
+ if ( !cancelled && !fired && !firing ) {
+ // make sure args are available (#8421)
+ args = args || [];
+ firing = 1;
+ try {
+ while( callbacks[ 0 ] ) {
+ callbacks.shift().apply( context, args );
+ }
+ }
+ finally {
+ fired = [ context, args ];
+ firing = 0;
+ }
+ }
+ return this;
+ },
+
+ // resolve with this as context and given arguments
+ resolve: function() {
+ deferred.resolveWith( this, arguments );
+ return this;
+ },
+
+ // Has this deferred been resolved?
+ isResolved: function() {
+ return !!( firing || fired );
+ },
+
+ // Cancel
+ cancel: function() {
+ cancelled = 1;
+ callbacks = [];
+ return this;
+ }
+ };
+
+ return deferred;
+ },
+
+ // Full fledged deferred (two callbacks list)
+ Deferred: function( func ) {
+ var deferred = jQuery._Deferred(),
+ failDeferred = jQuery._Deferred(),
+ promise;
+ // Add errorDeferred methods, then and promise
+ jQuery.extend( deferred, {
+ then: function( doneCallbacks, failCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+ },
+ fail: failDeferred.done,
+ rejectWith: failDeferred.resolveWith,
+ reject: failDeferred.resolve,
+ isRejected: failDeferred.isResolved,
+ pipe: function( fnDone, fnFail ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ if ( promise ) {
+ return promise;
+ }
+ promise = obj = {};
+ }
+ var i = promiseMethods.length;
+ while( i-- ) {
+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+ }
+ return obj;
+ }
+ });
+ // Make sure only one callback list will be used
+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+ // Unexpose cancel
+ delete deferred.cancel;
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = arguments,
+ i = 0,
+ length = args.length,
+ count = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ // Strange bug in FF4:
+ // Values changed onto the arguments object sometimes end up as undefined values
+ // outside the $.when method. Cloning the object into a fresh array solves the issue
+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+ }
+ };
+ }
+ if ( length > 1 ) {
+ for( ; i < length; i++ ) {
+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return deferred.promise();
+ }
+});
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ testElementParent,
+ testElement,
+ testElementStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type=checkbox>";
+
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains it's value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ // We use our own, invisible, body unless the body is already present
+ // in which case we use a div (#9239)
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ jQuery.extend( testElementStyle, {
+ position: "absolute",
+ left: "-1000px",
+ top: "-1000px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Remove the body element we added
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ // Null connected elements to avoid leaks in IE
+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([a-z])([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+ } else {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // Internal jQuery data is stored in a separate object inside the object's data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data
+ if ( pvt ) {
+ if ( !thisCache[ internalKey ] ) {
+ thisCache[ internalKey ] = {};
+ }
+
+ thisCache = thisCache[ internalKey ];
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+ // not attempt to inspect the internal events object using jQuery.data, as this
+ // internal data object is undocumented and subject to change.
+ if ( name === "events" && !thisCache[name] ) {
+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache,
+
+ // Reference to internal data cache key
+ internalKey = jQuery.expando,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
+ if ( thisCache ) {
+
+ // Support interoperable removal of hyphenated or camelcased keys
+ if ( !thisCache[ name ] ) {
+ name = jQuery.camelCase( name );
+ }
+
+ delete thisCache[ name ];
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !isEmptyDataObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( pvt ) {
+ delete cache[ id ][ internalKey ];
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ var internalCache = cache[ id ][ internalKey ];
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ // Ensure that `cache` is not a window object #10080
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the entire user cache at once because it's faster than
+ // iterating through each key, but we need to continue to persist internal
+ // data if it existed
+ if ( internalCache ) {
+ cache[ id ] = {};
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+
+ cache[ id ][ internalKey ] = internalCache;
+
+ // Otherwise, we need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ } else if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 ) {
+ var attr = this[0].attributes, name;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery.data( elem, deferDataKey, undefined, true );
+ if ( defer &&
+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.resolve();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = (type || "fx") + "mark";
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+ if ( count ) {
+ jQuery.data( elem, key, count, true );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ if ( elem ) {
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type, undefined, true );
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ defer;
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+ count++;
+ tmp.done( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ nodeHook, boolHook;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = (value || "").split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attrFix: {
+ // Always normalize to ensure hook usage
+ tabindex: "tabIndex"
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Normalize the name if needed
+ if ( notxml ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ hooks = jQuery.attrHooks[ name ];
+
+ if ( !hooks ) {
+ // Use boolHook for boolean attributes
+ if ( rboolean.test( name ) ) {
+ hooks = boolHook;
+
+ // Use nodeHook if available( IE6/7 )
+ } else if ( nodeHook ) {
+ hooks = nodeHook;
+ }
+ }
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, name ) {
+ var propName;
+ if ( elem.nodeType === 1 ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ jQuery.attr( elem, name, "" );
+ elem.removeAttribute( name );
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return (elem[ name ] = value);
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Add the tabindex propHook to attrHooks for back-compat
+jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode;
+ return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ // Return undefined if nodeValue is empty string
+ return ret && ret.nodeValue !== "" ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return (ret.nodeValue = value + "");
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return (elem.style.cssText = "" + value);
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
+ }
+ }
+ });
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ } else if ( !handler ) {
+ // Fixes bug #7229. Fix recommended by jdalton
+ return;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery._data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events,
+ eventHandle = elemData.handle;
+
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem, undefined, true );
+ }
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ exclusive;
+
+ if ( type.indexOf("!") >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ jQuery.each( jQuery.cache, function() {
+ // internalKey variable is just used to make it easier to find
+ // and potentially change this stuff later; currently it just
+ // points to jQuery.expando
+ var internalKey = jQuery.expando,
+ internalCache = this[ internalKey ];
+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+ jQuery.event.trigger( event, data, internalCache.handle.elem );
+ }
+ });
+ return;
+ }
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ var cur = elem,
+ // IE doesn't like method names with a colon (#3533, #8272)
+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+ // Fire event on the current element, then bubble up the DOM tree
+ do {
+ var handle = jQuery._data( cur, "handle" );
+
+ event.currentTarget = cur;
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Trigger an inline bound script
+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+
+ // Bubble up to document, then to window
+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+ } while ( cur && !event.isPropagationStopped() );
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+ var old,
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+ try {
+ if ( ontype && elem[ type ] ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ }
+ } catch ( ieError ) {}
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+
+ jQuery.event.triggered = undefined;
+ }
+ }
+
+ return event.result;
+ },
+
+ handle: function( event ) {
+ event = jQuery.event.fix( event || window.event );
+ // Snapshot the handlers list since a called handler may add/remove events.
+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+ run_all = !event.exclusive && !event.namespace,
+ args = Array.prototype.slice.call( arguments, 0 );
+
+ // Use the fix-ed Event rather than the (read-only) native event
+ args[0] = event;
+ event.currentTarget = this;
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Triggered event must 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event.
+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ return event.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( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ // Fixes #1925 where srcElement might not be defined either
+ event.target = event.srcElement || document;
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var eventDocument = event.target.ownerDocument || document,
+ doc = eventDocument.documentElement,
+ body = eventDocument.body;
+
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+
+ // Check if mouse(over|out) are still within the same parent element
+ var related = event.relatedTarget,
+ inside = false,
+ eventType = event.type;
+
+ event.type = event.data;
+
+ if ( related !== this ) {
+
+ if ( related ) {
+ inside = jQuery.contains( this, related );
+ }
+
+ if ( !inside ) {
+
+ jQuery.event.handle.apply( this, arguments );
+
+ event.type = eventType;
+ }
+ }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( !jQuery.nodeName( this, "form" ) ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
+ val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( jQuery.nodeName( elem, "select" ) ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery._data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery._data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery._data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ // Don't pass args or remember liveFired; they apply to the donor event.
+ var event = jQuery.extend( {}, args[ 0 ] );
+ event.type = type;
+ event.originalEvent = {};
+ event.liveFired = undefined;
+ jQuery.event.handle.call( elem, event );
+ if ( event.isDefaultPrevented() ) {
+ args[ 0 ].preventDefault();
+ }
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0;
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( donor ) {
+ // Donor event is always a native one; fix it and switch its type.
+ // Let focusin/out handler cancel the donor focus/blur event.
+ var e = jQuery.event.fix( donor );
+ e.type = fix;
+ e.originalEvent = {};
+ jQuery.event.trigger( e, null, e.target );
+ if ( e.isDefaultPrevented() ) {
+ donor.preventDefault();
+ }
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ var handler;
+
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( arguments.length === 2 || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ if ( name === "one" ) {
+ handler = function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ };
+ handler.guid = fn.guid || jQuery.guid++;
+ } else {
+ handler = fn;
+ }
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( name === "die" && !types &&
+ origSelector && origSelector.charAt(0) === "." ) {
+
+ context.unbind( origSelector );
+
+ return this;
+ }
+
+ if ( data === false || jQuery.isFunction( data ) ) {
+ fn = data || returnFalse;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( liveMap[ type ] ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
+ events = jQuery._data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+ // Make sure not to accidentally match a child element with the same selector
+ if ( related && jQuery.contains( elem, related ) ) {
+ related = elem;
+ }
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
+}
+
+jQuery.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( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var match,
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var found, item,
+ filter = Expr.filter[ type ],
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ var first = match[2],
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && ( typeof selector === "string" ?
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array
+ if ( jQuery.isArray( selectors ) ) {
+ var match, selector,
+ matches = {},
+ level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[ selector ] ) {
+ matches[ selector ] = POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[ selector ];
+
+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || (l > 1 && i < lastIndex) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando,
+ oldData = jQuery.data( src ),
+ curData = jQuery.data( dest, oldData );
+
+ // Switch to use the internal data object, if it exists, for the next
+ // stage of data copying
+ if ( (oldData = oldData[ internalKey ]) ) {
+ var events = oldData.events;
+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc;
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( "getElementsByTagName" in elem ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( "querySelectorAll" in elem ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( "getElementsByTagName" in elem ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ] && cache[ id ][ internalKey ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWH( elem, name, extra );
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ return val;
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat( value );
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+ style = elem.style;
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ left = style.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ which = name === "width" ? cssWidth : cssHeight;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ] || 0;
+ }
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ jQuery.each( which, function() {
+ val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts,
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for(; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery._Deferred(),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ statusText = nativeStatusText,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.done;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for( key in s.converters ) {
+ if( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ if ( this[i].style ) {
+ var display = jQuery.css( this[i], "display" );
+
+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+ jQuery._data( this[i], "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p,
+ display, e,
+ parts, start, end, unit;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height
+ // animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+ if ( !jQuery.support.inlineBlockNeedsLayout ) {
+ this.style.display = "inline-block";
+
+ } else {
+ display = defaultDisplay( this.nodeName );
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( display === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.display = "inline";
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ((end || 1) / e.cur()) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+ while ( i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue !== false ) {
+ jQuery.dequeue( this );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx;
+
+ this.startTime = fxNow || createFxNow();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options,
+ i, n;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( i in options.animatedProperties ) {
+ if ( options.animatedProperties[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function (index, value) {
+ elem.style[ "overflow" + value ] = options.overflow[index];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery(elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( var p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[p] );
+ }
+ }
+
+ // Execute the complete function
+ options.complete.call( elem );
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
+ html = "<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>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed";
+ checkDiv.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden";
+ innerDiv.style.position = "relative";
+
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if (options.top != null) {
+ props.top = (options.top - curOffset.top) + curTop;
+ }
+ if (options.left != null) {
+ props.left = (options.left - curOffset.left) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ],
+ body = elem.document.body;
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ body && body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNaN( ret ) ? orig : ret;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+})(window);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js
new file mode 100644
index 0000000..11e6d06
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js
@@ -0,0 +1,9046 @@
+/*!
+ * jQuery JavaScript Library v1.6.4
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Mon Sep 12 18:54:48 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.6.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery._Deferred();
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return (new Function( "return " + data ))();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( !array ) {
+ return -1;
+ }
+
+ if ( indexOf ) {
+ return indexOf.call( array, elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+var // Promise methods
+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+ // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+ // Create a simple deferred (one callbacks list)
+ _Deferred: function() {
+ var // callbacks list
+ callbacks = [],
+ // stored [ context , args ]
+ fired,
+ // to avoid firing when already doing so
+ firing,
+ // flag to know if the deferred has been cancelled
+ cancelled,
+ // the deferred itself
+ deferred = {
+
+ // done( f1, f2, ...)
+ done: function() {
+ if ( !cancelled ) {
+ var args = arguments,
+ i,
+ length,
+ elem,
+ type,
+ _fired;
+ if ( fired ) {
+ _fired = fired;
+ fired = 0;
+ }
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ deferred.done.apply( deferred, elem );
+ } else if ( type === "function" ) {
+ callbacks.push( elem );
+ }
+ }
+ if ( _fired ) {
+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+ }
+ }
+ return this;
+ },
+
+ // resolve with given context and args
+ resolveWith: function( context, args ) {
+ if ( !cancelled && !fired && !firing ) {
+ // make sure args are available (#8421)
+ args = args || [];
+ firing = 1;
+ try {
+ while( callbacks[ 0 ] ) {
+ callbacks.shift().apply( context, args );
+ }
+ }
+ finally {
+ fired = [ context, args ];
+ firing = 0;
+ }
+ }
+ return this;
+ },
+
+ // resolve with this as context and given arguments
+ resolve: function() {
+ deferred.resolveWith( this, arguments );
+ return this;
+ },
+
+ // Has this deferred been resolved?
+ isResolved: function() {
+ return !!( firing || fired );
+ },
+
+ // Cancel
+ cancel: function() {
+ cancelled = 1;
+ callbacks = [];
+ return this;
+ }
+ };
+
+ return deferred;
+ },
+
+ // Full fledged deferred (two callbacks list)
+ Deferred: function( func ) {
+ var deferred = jQuery._Deferred(),
+ failDeferred = jQuery._Deferred(),
+ promise;
+ // Add errorDeferred methods, then and promise
+ jQuery.extend( deferred, {
+ then: function( doneCallbacks, failCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+ },
+ fail: failDeferred.done,
+ rejectWith: failDeferred.resolveWith,
+ reject: failDeferred.resolve,
+ isRejected: failDeferred.isResolved,
+ pipe: function( fnDone, fnFail ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ if ( promise ) {
+ return promise;
+ }
+ promise = obj = {};
+ }
+ var i = promiseMethods.length;
+ while( i-- ) {
+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+ }
+ return obj;
+ }
+ });
+ // Make sure only one callback list will be used
+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+ // Unexpose cancel
+ delete deferred.cancel;
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = arguments,
+ i = 0,
+ length = args.length,
+ count = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ // Strange bug in FF4:
+ // Values changed onto the arguments object sometimes end up as undefined values
+ // outside the $.when method. Cloning the object into a fresh array solves the issue
+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+ }
+ };
+ }
+ if ( length > 1 ) {
+ for( ; i < length; i++ ) {
+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return deferred.promise();
+ }
+});
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ testElementParent,
+ testElement,
+ testElementStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains it's value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ // We use our own, invisible, body unless the body is already present
+ // in which case we use a div (#9239)
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ jQuery.extend( testElementStyle, {
+ position: "absolute",
+ left: "-1000px",
+ top: "-1000px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Remove the body element we added
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ // Null connected elements to avoid leaks in IE
+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+ } else {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // Internal jQuery data is stored in a separate object inside the object's data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data
+ if ( pvt ) {
+ if ( !thisCache[ internalKey ] ) {
+ thisCache[ internalKey ] = {};
+ }
+
+ thisCache = thisCache[ internalKey ];
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+ // not attempt to inspect the internal events object using jQuery.data, as this
+ // internal data object is undocumented and subject to change.
+ if ( name === "events" && !thisCache[name] ) {
+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache,
+
+ // Reference to internal data cache key
+ internalKey = jQuery.expando,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
+ if ( thisCache ) {
+
+ // Support interoperable removal of hyphenated or camelcased keys
+ if ( !thisCache[ name ] ) {
+ name = jQuery.camelCase( name );
+ }
+
+ delete thisCache[ name ];
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !isEmptyDataObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( pvt ) {
+ delete cache[ id ][ internalKey ];
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ var internalCache = cache[ id ][ internalKey ];
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ // Ensure that `cache` is not a window object #10080
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the entire user cache at once because it's faster than
+ // iterating through each key, but we need to continue to persist internal
+ // data if it existed
+ if ( internalCache ) {
+ cache[ id ] = {};
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+
+ cache[ id ][ internalKey ] = internalCache;
+
+ // Otherwise, we need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ } else if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 ) {
+ var attr = this[0].attributes, name;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery.data( elem, deferDataKey, undefined, true );
+ if ( defer &&
+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.resolve();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = (type || "fx") + "mark";
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+ if ( count ) {
+ jQuery.data( elem, key, count, true );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ if ( elem ) {
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type, undefined, true );
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ defer;
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+ count++;
+ tmp.done( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ nodeHook, boolHook;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = (value || "").split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attrFix: {
+ // Always normalize to ensure hook usage
+ tabindex: "tabIndex"
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Normalize the name if needed
+ if ( notxml ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ hooks = jQuery.attrHooks[ name ];
+
+ if ( !hooks ) {
+ // Use boolHook for boolean attributes
+ if ( rboolean.test( name ) ) {
+ hooks = boolHook;
+
+ // Use nodeHook if available( IE6/7 )
+ } else if ( nodeHook ) {
+ hooks = nodeHook;
+ }
+ }
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, name ) {
+ var propName;
+ if ( elem.nodeType === 1 ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ jQuery.attr( elem, name, "" );
+ elem.removeAttribute( name );
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return (elem[ name ] = value);
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Add the tabindex propHook to attrHooks for back-compat
+jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode;
+ return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ // Return undefined if nodeValue is empty string
+ return ret && ret.nodeValue !== "" ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return (ret.nodeValue = value + "");
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return (elem.style.cssText = "" + value);
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
+ }
+ }
+ });
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ } else if ( !handler ) {
+ // Fixes bug #7229. Fix recommended by jdalton
+ return;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery._data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events,
+ eventHandle = elemData.handle;
+
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem, undefined, true );
+ }
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ exclusive;
+
+ if ( type.indexOf("!") >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ jQuery.each( jQuery.cache, function() {
+ // internalKey variable is just used to make it easier to find
+ // and potentially change this stuff later; currently it just
+ // points to jQuery.expando
+ var internalKey = jQuery.expando,
+ internalCache = this[ internalKey ];
+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+ jQuery.event.trigger( event, data, internalCache.handle.elem );
+ }
+ });
+ return;
+ }
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ var cur = elem,
+ // IE doesn't like method names with a colon (#3533, #8272)
+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+ // Fire event on the current element, then bubble up the DOM tree
+ do {
+ var handle = jQuery._data( cur, "handle" );
+
+ event.currentTarget = cur;
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Trigger an inline bound script
+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+
+ // Bubble up to document, then to window
+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+ } while ( cur && !event.isPropagationStopped() );
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+ var old,
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+ try {
+ if ( ontype && elem[ type ] ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ }
+ } catch ( ieError ) {}
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+
+ jQuery.event.triggered = undefined;
+ }
+ }
+
+ return event.result;
+ },
+
+ handle: function( event ) {
+ event = jQuery.event.fix( event || window.event );
+ // Snapshot the handlers list since a called handler may add/remove events.
+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+ run_all = !event.exclusive && !event.namespace,
+ args = Array.prototype.slice.call( arguments, 0 );
+
+ // Use the fix-ed Event rather than the (read-only) native event
+ args[0] = event;
+ event.currentTarget = this;
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Triggered event must 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event.
+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ return event.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( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ // Fixes #1925 where srcElement might not be defined either
+ event.target = event.srcElement || document;
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var eventDocument = event.target.ownerDocument || document,
+ doc = eventDocument.documentElement,
+ body = eventDocument.body;
+
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+
+ // Check if mouse(over|out) are still within the same parent element
+ var related = event.relatedTarget,
+ inside = false,
+ eventType = event.type;
+
+ event.type = event.data;
+
+ if ( related !== this ) {
+
+ if ( related ) {
+ inside = jQuery.contains( this, related );
+ }
+
+ if ( !inside ) {
+
+ jQuery.event.handle.apply( this, arguments );
+
+ event.type = eventType;
+ }
+ }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( !jQuery.nodeName( this, "form" ) ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ // Avoid triggering error on non-existent type attribute in IE VML (#7071)
+ var elem = e.target,
+ type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
+ val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( jQuery.nodeName( elem, "select" ) ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery._data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery._data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery._data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ // Don't pass args or remember liveFired; they apply to the donor event.
+ var event = jQuery.extend( {}, args[ 0 ] );
+ event.type = type;
+ event.originalEvent = {};
+ event.liveFired = undefined;
+ jQuery.event.handle.call( elem, event );
+ if ( event.isDefaultPrevented() ) {
+ args[ 0 ].preventDefault();
+ }
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0;
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( donor ) {
+ // Donor event is always a native one; fix it and switch its type.
+ // Let focusin/out handler cancel the donor focus/blur event.
+ var e = jQuery.event.fix( donor );
+ e.type = fix;
+ e.originalEvent = {};
+ jQuery.event.trigger( e, null, e.target );
+ if ( e.isDefaultPrevented() ) {
+ donor.preventDefault();
+ }
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ var handler;
+
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( arguments.length === 2 || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ if ( name === "one" ) {
+ handler = function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ };
+ handler.guid = fn.guid || jQuery.guid++;
+ } else {
+ handler = fn;
+ }
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( name === "die" && !types &&
+ origSelector && origSelector.charAt(0) === "." ) {
+
+ context.unbind( origSelector );
+
+ return this;
+ }
+
+ if ( data === false || jQuery.isFunction( data ) ) {
+ fn = data || returnFalse;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( liveMap[ type ] ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
+ events = jQuery._data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+ // Make sure not to accidentally match a child element with the same selector
+ if ( related && jQuery.contains( elem, related ) ) {
+ related = elem;
+ }
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
+}
+
+jQuery.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( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var match,
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var found, item,
+ filter = Expr.filter[ type ],
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ var first = match[2],
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && ( typeof selector === "string" ?
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array
+ if ( jQuery.isArray( selectors ) ) {
+ var match, selector,
+ matches = {},
+ level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[ selector ] ) {
+ matches[ selector ] = POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[ selector ];
+
+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || (l > 1 && i < lastIndex) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando,
+ oldData = jQuery.data( src ),
+ curData = jQuery.data( dest, oldData );
+
+ // Switch to use the internal data object, if it exists, for the next
+ // stage of data copying
+ if ( (oldData = oldData[ internalKey ]) ) {
+ var events = oldData.events;
+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc;
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( "getElementsByTagName" in elem ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( "querySelectorAll" in elem ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( "getElementsByTagName" in elem ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ] && cache[ id ][ internalKey ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWH( elem, name, extra );
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ return val;
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat( value );
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+ style = elem.style;
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ left = style.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ which = name === "width" ? cssWidth : cssHeight;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ] || 0;
+ }
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ jQuery.each( which, function() {
+ val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts,
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for(; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery._Deferred(),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ statusText = nativeStatusText,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.done;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for( key in s.converters ) {
+ if( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ if ( this[i].style ) {
+ var display = jQuery.css( this[i], "display" );
+
+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+ jQuery._data( this[i], "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p,
+ display, e,
+ parts, start, end, unit;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height
+ // animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+ if ( !jQuery.support.inlineBlockNeedsLayout ) {
+ this.style.display = "inline-block";
+
+ } else {
+ display = defaultDisplay( this.nodeName );
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( display === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.display = "inline";
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ((end || 1) / e.cur()) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+ while ( i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue !== false ) {
+ jQuery.dequeue( this );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx;
+
+ this.startTime = fxNow || createFxNow();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options,
+ i, n;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( i in options.animatedProperties ) {
+ if ( options.animatedProperties[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function (index, value) {
+ elem.style[ "overflow" + value ] = options.overflow[index];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery(elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( var p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[p] );
+ }
+ }
+
+ // Execute the complete function
+ options.complete.call( elem );
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
+ html = "<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>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed";
+ checkDiv.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden";
+ innerDiv.style.position = "relative";
+
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if (options.top != null) {
+ props.top = (options.top - curOffset.top) + curTop;
+ }
+ if (options.left != null) {
+ props.left = (options.left - curOffset.left) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem && elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ],
+ body = elem.document.body;
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ body && body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNaN( ret ) ? orig : ret;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+})(window);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.js
new file mode 100644
index 0000000..9a13ab9
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.js
@@ -0,0 +1,8865 @@
+/*!
+ * jQuery JavaScript Library v1.6
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Mon May 2 13:50:00 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.6",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery._Deferred();
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return (new Function( "return " + data ))();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ // (xml & tmp used internally)
+ parseXML: function( data , xml , tmp ) {
+
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+
+ tmp = xml.documentElement;
+
+ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+
+ if ( indexOf ) {
+ return indexOf.call( array, elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can be optionally by executed if its a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+// Expose jQuery to the global object
+return jQuery;
+
+})();
+
+
+var // Promise methods
+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+ // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+ // Create a simple deferred (one callbacks list)
+ _Deferred: function() {
+ var // callbacks list
+ callbacks = [],
+ // stored [ context , args ]
+ fired,
+ // to avoid firing when already doing so
+ firing,
+ // flag to know if the deferred has been cancelled
+ cancelled,
+ // the deferred itself
+ deferred = {
+
+ // done( f1, f2, ...)
+ done: function() {
+ if ( !cancelled ) {
+ var args = arguments,
+ i,
+ length,
+ elem,
+ type,
+ _fired;
+ if ( fired ) {
+ _fired = fired;
+ fired = 0;
+ }
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ deferred.done.apply( deferred, elem );
+ } else if ( type === "function" ) {
+ callbacks.push( elem );
+ }
+ }
+ if ( _fired ) {
+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+ }
+ }
+ return this;
+ },
+
+ // resolve with given context and args
+ resolveWith: function( context, args ) {
+ if ( !cancelled && !fired && !firing ) {
+ // make sure args are available (#8421)
+ args = args || [];
+ firing = 1;
+ try {
+ while( callbacks[ 0 ] ) {
+ callbacks.shift().apply( context, args );
+ }
+ }
+ finally {
+ fired = [ context, args ];
+ firing = 0;
+ }
+ }
+ return this;
+ },
+
+ // resolve with this as context and given arguments
+ resolve: function() {
+ deferred.resolveWith( this, arguments );
+ return this;
+ },
+
+ // Has this deferred been resolved?
+ isResolved: function() {
+ return !!( firing || fired );
+ },
+
+ // Cancel
+ cancel: function() {
+ cancelled = 1;
+ callbacks = [];
+ return this;
+ }
+ };
+
+ return deferred;
+ },
+
+ // Full fledged deferred (two callbacks list)
+ Deferred: function( func ) {
+ var deferred = jQuery._Deferred(),
+ failDeferred = jQuery._Deferred(),
+ promise;
+ // Add errorDeferred methods, then and promise
+ jQuery.extend( deferred, {
+ then: function( doneCallbacks, failCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+ },
+ fail: failDeferred.done,
+ rejectWith: failDeferred.resolveWith,
+ reject: failDeferred.resolve,
+ isRejected: failDeferred.isResolved,
+ pipe: function( fnDone, fnFail ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject );
+ } else {
+ newDefer[ action ]( returned );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ if ( promise ) {
+ return promise;
+ }
+ promise = obj = {};
+ }
+ var i = promiseMethods.length;
+ while( i-- ) {
+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+ }
+ return obj;
+ }
+ });
+ // Make sure only one callback list will be used
+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+ // Unexpose cancel
+ delete deferred.cancel;
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = arguments,
+ i = 0,
+ length = args.length,
+ count = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ // Strange bug in FF4:
+ // Values changed onto the arguments object sometimes end up as undefined values
+ // outside the $.when method. Cloning the object into a fresh array solves the issue
+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+ }
+ };
+ }
+ if ( length > 1 ) {
+ for( ; i < length; i++ ) {
+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return deferred.promise();
+ }
+});
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ bodyStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ div.detachEvent( "onclick", click );
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains it's value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ // We use our own, invisible, body
+ body = document.createElement( "body" );
+ bodyStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ // Set background to avoid IE crashes when removing (#9028)
+ background: "none"
+ };
+ for ( i in bodyStyle ) {
+ body.style[ i ] = bodyStyle[ i ];
+ }
+ body.appendChild( div );
+ document.documentElement.appendChild( body );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( document.defaultView.getComputedStyle( marginDiv, null ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Remove the body element we added
+ body.innerHTML = "";
+ document.documentElement.removeChild( body );
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([a-z])([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+ } else {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // Internal jQuery data is stored in a separate object inside the object's data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data
+ if ( pvt ) {
+ if ( !thisCache[ internalKey ] ) {
+ thisCache[ internalKey ] = {};
+ }
+
+ thisCache = thisCache[ internalKey ];
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ name ] = data;
+ }
+
+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+ // not attempt to inspect the internal events object using jQuery.data, as this
+ // internal data object is undocumented and subject to change.
+ if ( name === "events" && !thisCache[name] ) {
+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+ }
+
+ return getByName ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando, isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+ var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
+ if ( thisCache ) {
+ delete thisCache[ name ];
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !isEmptyDataObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( pvt ) {
+ delete cache[ id ][ internalKey ];
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ var internalCache = cache[ id ][ internalKey ];
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ if ( jQuery.support.deleteExpando || cache != window ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the entire user cache at once because it's faster than
+ // iterating through each key, but we need to continue to persist internal
+ // data if it existed
+ if ( internalCache ) {
+ cache[ id ] = {};
+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+ // metadata on plain JS objects when the object is serialized using
+ // JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+
+ cache[ id ][ internalKey ] = internalCache;
+
+ // Otherwise, we need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ } else if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 ) {
+ var attr = this[0].attributes, name;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery.data( elem, deferDataKey, undefined, true );
+ if ( defer &&
+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.resolve();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = (type || "fx") + "mark";
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+ if ( count ) {
+ jQuery.data( elem, key, count, true );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ if ( elem ) {
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type, undefined, true );
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ defer;
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark";
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+ count++;
+ tmp.done( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rspecial = /^(?:data-|aria-)/,
+ rinvalidChar = /\:/,
+ formHook;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class") || "") );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ",
+ setClass = elem.className;
+
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ setClass += " " + classNames[c];
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ return (elem.value || "").replace(rreturn, "");
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined) ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attrFix: {
+ // Always normalize to ensure hook usage
+ tabindex: "tabIndex",
+ readonly: "readOnly"
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Normalize the name if needed
+ name = notxml && jQuery.attrFix[ name ] || name;
+
+ // Get the appropriate hook, or the formHook
+ // if getSetAttribute is not supported and we have form objects in IE6/7
+ hooks = jQuery.attrHooks[ name ] ||
+ ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ?
+ formHook :
+ undefined );
+
+ if ( value !== undefined ) {
+
+ if ( value === null || (value === false && !rspecial.test( name )) ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+
+ // Set boolean attributes to the same name
+ if ( value === true && !rspecial.test( name ) ) {
+ value = name;
+ }
+
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else {
+
+ if ( hooks && "get" in hooks && notxml ) {
+ return hooks.get( elem, name );
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ }
+ },
+
+ removeAttr: function( elem, name ) {
+ if ( elem.nodeType === 1 ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ if ( jQuery.support.getSetAttribute ) {
+ // Use removeAttribute in browsers that support it
+ elem.removeAttribute( name );
+ } else {
+ jQuery.attr( elem, name, "" );
+ elem.removeAttributeNode( elem.getAttributeNode( name ) );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.getAttribute("value");
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabIndex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ },
+
+ propFix: {},
+
+ prop: function( elem, name, value ) {
+ var nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ var ret, hooks,
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.propFix[ name ] || name;
+
+ hooks = jQuery.propHooks[ name ];
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return (elem[ name ] = value);
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {}
+});
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+ jQuery.attrFix = jQuery.extend( jQuery.attrFix, {
+ "for": "htmlFor",
+ "class": "className",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ cellpadding: "cellPadding",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+ });
+
+ // Use this for any attribute on a form in IE6/7
+ formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
+ return elem.getAttribute( name );
+ }
+ ret = elem.getAttributeNode( name );
+ // Return undefined if not specified instead of empty string
+ return ret && ret.specified ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Check form objects in IE (multiple bugs related)
+ // Only use nodeValue if the attribute node exists on the form
+ var ret = elem.getAttributeNode( name );
+ if ( ret ) {
+ ret.nodeValue = value;
+ return value;
+ }
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return (elem.style.cssText = "" + value);
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+ });
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
+ }
+ }
+ });
+});
+
+
+
+
+var hasOwn = Object.prototype.hasOwnProperty,
+ rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ } else if ( !handler ) {
+ // Fixes bug #7229. Fix recommended by jdalton
+ return;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery._data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events,
+ eventHandle = elemData.handle;
+
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem, undefined, true );
+ }
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ exclusive;
+
+ if ( type.indexOf("!") >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ jQuery.each( jQuery.cache, function() {
+ // internalKey variable is just used to make it easier to find
+ // and potentially change this stuff later; currently it just
+ // points to jQuery.expando
+ var internalKey = jQuery.expando,
+ internalCache = this[ internalKey ];
+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+ jQuery.event.trigger( event, data, internalCache.handle.elem );
+ }
+ });
+ return;
+ }
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ var cur = elem,
+ // IE doesn't like method names with a colon (#3533, #8272)
+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+ // Fire event on the current element, then bubble up the DOM tree
+ do {
+ var handle = jQuery._data( cur, "handle" );
+
+ event.currentTarget = cur;
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Trigger an inline bound script
+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+
+ // Bubble up to document, then to window
+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+ } while ( cur && !event.isPropagationStopped() );
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+ var old,
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+ try {
+ if ( ontype && elem[ type ] ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ }
+ } catch ( ieError ) {}
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+
+ jQuery.event.triggered = undefined;
+ }
+ }
+
+ return event.result;
+ },
+
+ handle: function( event ) {
+ event = jQuery.event.fix( event || window.event );
+ // Snapshot the handlers list since a called handler may add/remove events.
+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+ run_all = !event.exclusive && !event.namespace,
+ args = Array.prototype.slice.call( arguments, 0 );
+
+ // Use the fix-ed Event rather than the (read-only) native event
+ args[0] = event;
+ event.currentTarget = this;
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Triggered event must 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event.
+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ return event.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( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ // Fixes #1925 where srcElement might not be defined either
+ event.target = event.srcElement || document;
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var eventDocument = event.target.ownerDocument || document,
+ doc = eventDocument.documentElement,
+ body = eventDocument.body;
+
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+
+ // Chrome does something similar, the parentNode property
+ // can be accessed but is null.
+ if ( parent && parent !== document && !parent.parentNode ) {
+ return;
+ }
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ parent = parent.parentNode;
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) { }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( !jQuery.nodeName( this, "form" ) ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target,
+ type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( jQuery.nodeName( elem, "select" ) ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery._data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery._data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery._data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ // Don't pass args or remember liveFired; they apply to the donor event.
+ var event = jQuery.extend( {}, args[ 0 ] );
+ event.type = type;
+ event.originalEvent = {};
+ event.liveFired = undefined;
+ jQuery.event.handle.call( elem, event );
+ if ( event.isDefaultPrevented() ) {
+ args[ 0 ].preventDefault();
+ }
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0;
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( donor ) {
+ // Donor event is always a native one; fix it and switch its type.
+ // Let focusin/out handler cancel the donor focus/blur event.
+ var e = jQuery.event.fix( donor );
+ e.type = fix;
+ e.originalEvent = {};
+ jQuery.event.trigger( e, null, e.target );
+ if ( e.isDefaultPrevented() ) {
+ donor.preventDefault();
+ }
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ var handler;
+
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( arguments.length === 2 || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ if ( name === "one" ) {
+ handler = function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ };
+ handler.guid = fn.guid || jQuery.guid++;
+ } else {
+ handler = fn;
+ }
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( name === "die" && !types &&
+ origSelector && origSelector.charAt(0) === "." ) {
+
+ context.unbind( origSelector );
+
+ return this;
+ }
+
+ if ( data === false || jQuery.isFunction( data ) ) {
+ fn = data || returnFalse;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( liveMap[ type ] ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
+ events = jQuery._data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+ // Make sure not to accidentally match a child element with the same selector
+ if ( related && jQuery.contains( elem, related ) ) {
+ related = elem;
+ }
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
+}
+
+jQuery.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( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var match,
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var found, item,
+ filter = Expr.filter[ type ],
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ var first = match[2],
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && ( typeof selector === "string" ?
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array
+ if ( jQuery.isArray( selectors ) ) {
+ var match, selector,
+ matches = {},
+ level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[ selector ] ) {
+ matches[ selector ] = POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[ selector ];
+
+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ wrapMap = {
+ 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, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || (l > 1 && i < lastIndex) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var internalKey = jQuery.expando,
+ oldData = jQuery.data( src ),
+ curData = jQuery.data( dest, oldData );
+
+ // Switch to use the internal data object, if it exists, for the next
+ // stage of data copying
+ if ( (oldData = oldData[ internalKey ]) ) {
+ var events = oldData.events;
+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults,
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( "getElementsByTagName" in elem ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( "querySelectorAll" in elem ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( elem.getElementsByTagName ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( i = 0; i < len; i++ ) {
+ findInputs( elem[i] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ] && cache[ id ][ internalKey ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ rdashAlpha = /-([a-z])/ig,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^[+\-]=/,
+ rrelNumFilter = /[^+\-\.\de]+/g,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle,
+
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "zIndex": true,
+ "fontWeight": true,
+ "opacity": true,
+ "zoom": true,
+ "lineHeight": true,
+ "widows": true,
+ "orphans": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( type === "number" && isNaN( value ) || value == null ) {
+ return;
+ }
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && rrelNum.test( value ) ) {
+ value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ },
+
+ camelCase: function( string ) {
+ return string.replace( rdashAlpha, fcamelCase );
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ val = getWH( elem, name, extra );
+
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ if ( val <= 0 ) {
+ val = curCSS( elem, name, name );
+
+ if ( val === "0px" && currentStyle ) {
+ val = currentStyle( elem, name, name );
+ }
+
+ if ( val != null ) {
+ // Should return "auto" instead of 0, use 0 for
+ // temporary backwards-compat
+ return val === "" || val === "auto" ? "0px" : val;
+ }
+ }
+
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+
+ // Should return "auto" instead of 0, use 0 for
+ // temporary backwards-compat
+ return val === "" || val === "auto" ? "0px" : val;
+ }
+
+ return typeof val === "string" ? val : val + "px";
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat(value);
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle;
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = jQuery.isNaN( value ) ?
+ "" :
+ "alpha(opacity=" + value * 100 + ")",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+ style = elem.style;
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ left = style.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+ var which = name === "width" ? cssWidth : cssHeight,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return val;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
+
+ } else {
+ val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
+ }
+ });
+
+ return val;
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts;
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for(; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function ( target, settings ) {
+ if ( !settings ) {
+ // Only one parameter, we extend ajaxSettings
+ settings = target;
+ target = jQuery.extend( true, jQuery.ajaxSettings, settings );
+ } else {
+ // target was provided, we extend into it
+ jQuery.extend( true, target, jQuery.ajaxSettings, settings );
+ }
+ // Flatten fields we don't want deep extended
+ for( var field in { context: 1, url: 1 } ) {
+ if ( field in settings ) {
+ target[ field ] = settings[ field ];
+ } else if( field in jQuery.ajaxSettings ) {
+ target[ field ] = jQuery.ajaxSettings[ field ];
+ }
+ }
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ 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"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery._Deferred(),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, statusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = statusText;
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.done;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( status < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for( key in s.converters ) {
+ if( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow,
+ requestAnimationFrame = window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[i];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ if ( this[i].style ) {
+ var display = jQuery.css( this[i], "display" );
+
+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+ jQuery._data( this[i], "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend({}, optall),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p,
+ display, e,
+ parts, start, end, unit;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[name];
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height
+ // animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+ if ( !jQuery.support.inlineBlockNeedsLayout ) {
+ this.style.display = "inline-block";
+
+ } else {
+ display = defaultDisplay(this.nodeName);
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( display === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.display = "inline";
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ opt.animatedProperties[name] = jQuery.isArray( val ) ?
+ val[1]:
+ opt.specialEasing && opt.specialEasing[name] || opt.easing || 'swing';
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+
+ val = prop[p];
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
+
+ } else {
+ parts = rfxnum.exec(val);
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ((end || 1) / e.cur()) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+ // go in reverse order so anything added to the queue during the loop is ignored
+ while ( i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function( noUnmark ) {
+ if ( opt.queue !== false ) {
+ jQuery.dequeue( this );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx,
+ raf;
+
+ this.startTime = fxNow || createFxNow();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ // Use requestAnimationFrame instead of setInterval if available
+ if ( requestAnimationFrame ) {
+ timerId = 1;
+ raf = function() {
+ // When timerId gets set to null at any point, this stops
+ if ( timerId ) {
+ requestAnimationFrame( raf );
+ fx.tick();
+ }
+ };
+ requestAnimationFrame( raf );
+ } else {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options,
+ i, n;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( i in options.animatedProperties ) {
+ if ( options.animatedProperties[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function (index, value) {
+ elem.style[ "overflow" + value ] = options.overflow[index];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery(elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( var p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[p] );
+ }
+ }
+
+ // Execute the complete function
+ options.complete.call( elem );
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+
+ this.state = n / options.duration;
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[options.animatedProperties[this.prop]](this.state, n, 0, 1, options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers,
+ i = timers.length;
+ while ( i-- ) {
+ if ( !timers[i]() ) {
+ timers.splice(i, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var elem = jQuery( "<" + nodeName + ">" ).appendTo( "body" ),
+ display = elem.css( "display" );
+
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ document.body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake html
+ // document to it, Webkit & Firefox won't allow reusing the iframe document
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( "<!doctype><html><body></body></html>" );
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+
+ document.body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
+ html = "<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>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed";
+ checkDiv.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden";
+ innerDiv.style.position = "relative";
+
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if (options.top != null) {
+ props.top = (options.top - curOffset.top) + curTop;
+ }
+ if (options.left != null) {
+ props.left = (options.left - curOffset.left) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ parseFloat( jQuery.css( this[0], type, "padding" ) ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ];
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ elem.document.body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNaN( ret ) ? orig : ret;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+window.jQuery = window.$ = jQuery;
+})(window);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js
new file mode 100644
index 0000000..8ccd0ea
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js
@@ -0,0 +1,9266 @@
+/*!
+ * jQuery JavaScript Library v1.7.1
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Mon Nov 21 21:11:03 2011 -0500
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = ( context ? context.ownerDocument || context : document );
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.7.1",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.add( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ i = +i;
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.fireWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).off( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery.Callbacks( "once memory" );
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array, i ) {
+ var len;
+
+ if ( array ) {
+ if ( indexOf ) {
+ return indexOf.call( array, elem, i );
+ }
+
+ len = array.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in array && array[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+// String to Object flags format cache
+var flagsCache = {};
+
+// Convert String-formatted flags into Object-formatted ones and store in cache
+function createFlags( flags ) {
+ var object = flagsCache[ flags ] = {},
+ i, length;
+ flags = flags.split( /\s+/ );
+ for ( i = 0, length = flags.length; i < length; i++ ) {
+ object[ flags[i] ] = true;
+ }
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * flags: an optional list of space-separated flags that will change how
+ * the callback list behaves
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible flags:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( flags ) {
+
+ // Convert flags from String-formatted to Object-formatted
+ // (we check in cache first)
+ flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+
+ var // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = [],
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Add one or several callbacks to the list
+ add = function( args ) {
+ var i,
+ length,
+ elem,
+ type,
+ actual;
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ // Inspect recursively
+ add( elem );
+ } else if ( type === "function" ) {
+ // Add if not in unique mode and callback is not in
+ if ( !flags.unique || !self.has( elem ) ) {
+ list.push( elem );
+ }
+ }
+ }
+ },
+ // Fire callbacks
+ fire = function( context, args ) {
+ args = args || [];
+ memory = !flags.memory || [ context, args ];
+ firing = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
+ memory = true; // Mark as halted
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( !flags.once ) {
+ if ( stack && stack.length ) {
+ memory = stack.shift();
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
+ }
+ } else if ( memory === true ) {
+ self.disable();
+ } else {
+ list = [];
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ var length = list.length;
+ add( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away, unless previous
+ // firing was halted (stopOnFalse)
+ } else if ( memory && memory !== true ) {
+ firingStart = length;
+ fire( memory[ 0 ], memory[ 1 ] );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ var args = arguments,
+ argIndex = 0,
+ argLength = args.length;
+ for ( ; argIndex < argLength ; argIndex++ ) {
+ for ( var i = 0; i < list.length; i++ ) {
+ if ( args[ argIndex ] === list[ i ] ) {
+ // Handle firingIndex and firingLength
+ if ( firing ) {
+ if ( i <= firingLength ) {
+ firingLength--;
+ if ( i <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ // Remove the element
+ list.splice( i--, 1 );
+ // If we have some unicity property then
+ // we only need to do this once
+ if ( flags.unique ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+ return this;
+ },
+ // Control if a given callback is in the list
+ has: function( fn ) {
+ if ( list ) {
+ var i = 0,
+ length = list.length;
+ for ( ; i < length; i++ ) {
+ if ( fn === list[ i ] ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory || memory === true ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( stack ) {
+ if ( firing ) {
+ if ( !flags.once ) {
+ stack.push( [ context, args ] );
+ }
+ } else if ( !( flags.once && memory ) ) {
+ fire( context, args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!memory;
+ }
+ };
+
+ return self;
+};
+
+
+
+
+var // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var doneList = jQuery.Callbacks( "once memory" ),
+ failList = jQuery.Callbacks( "once memory" ),
+ progressList = jQuery.Callbacks( "memory" ),
+ state = "pending",
+ lists = {
+ resolve: doneList,
+ reject: failList,
+ notify: progressList
+ },
+ promise = {
+ done: doneList.add,
+ fail: failList.add,
+ progress: progressList.add,
+
+ state: function() {
+ return state;
+ },
+
+ // Deprecated
+ isResolved: doneList.fired,
+ isRejected: failList.fired,
+
+ then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
+ return this;
+ },
+ always: function() {
+ deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
+ return this;
+ },
+ pipe: function( fnDone, fnFail, fnProgress ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ],
+ progress: [ fnProgress, "notify" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ obj = promise;
+ } else {
+ for ( var key in promise ) {
+ obj[ key ] = promise[ key ];
+ }
+ }
+ return obj;
+ }
+ },
+ deferred = promise.promise({}),
+ key;
+
+ for ( key in lists ) {
+ deferred[ key ] = lists[ key ].fire;
+ deferred[ key + "With" ] = lists[ key ].fireWith;
+ }
+
+ // Handle state
+ deferred.done( function() {
+ state = "resolved";
+ }, failList.disable, progressList.lock ).fail( function() {
+ state = "rejected";
+ }, doneList.disable, progressList.lock );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = sliceDeferred.call( arguments, 0 ),
+ i = 0,
+ length = args.length,
+ pValues = new Array( length ),
+ count = length,
+ pCount = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred(),
+ promise = deferred.promise();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ deferred.resolveWith( deferred, args );
+ }
+ };
+ }
+ function progressFunc( i ) {
+ return function( value ) {
+ pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ deferred.notifyWith( promise, pValues );
+ };
+ }
+ if ( length > 1 ) {
+ for ( ; i < length; i++ ) {
+ if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return promise;
+ }
+});
+
+
+
+
+jQuery.support = (function() {
+
+ var support,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ fragment,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported,
+ div = document.createElement( "div" ),
+ documentElement = document.documentElement;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute("href") === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Tests for enctype support on a form(#6743)
+ enctype: !!document.createElement("form").enctype,
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains its value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.lastChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ fragment.removeChild( input );
+ fragment.appendChild( div );
+
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( window.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.style.width = "2px";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Technique from Juriy Zaytsev
+ // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ }) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ fragment.removeChild( div );
+
+ // Null elements to avoid leaks in IE
+ fragment = select = opt = marginDiv = div = input = null;
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, outer, inner, table, td, offsetSupport,
+ conMarginTop, ptlm, vb, style, html,
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ conMarginTop = 1;
+ ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
+ vb = "visibility:hidden;border:0;";
+ style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
+ html = "<div " + style + "><div></div></div>" +
+ "<table " + style + " cellpadding='0' cellspacing='0'>" +
+ "<tr><td></td></tr></table>";
+
+ container = document.createElement("div");
+ container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
+ body.insertBefore( container, body.firstChild );
+
+ // Construct the test element
+ div = document.createElement("div");
+ container.appendChild( div );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE <= 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Figure out if the W3C box model works as expected
+ div.innerHTML = "";
+ div.style.width = div.style.paddingLeft = "1px";
+ jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
+
+ if ( typeof div.style.zoom !== "undefined" ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.style.cssText = ptlm + vb;
+ div.innerHTML = html;
+
+ outer = div.firstChild;
+ inner = outer.firstChild;
+ td = outer.nextSibling.firstChild.firstChild;
+
+ offsetSupport = {
+ doesNotAddBorder: ( inner.offsetTop !== 5 ),
+ doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
+ };
+
+ inner.style.position = "fixed";
+ inner.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
+ inner.style.position = inner.style.top = "";
+
+ outer.style.overflow = "hidden";
+ outer.style.position = "relative";
+
+ offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
+ offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
+
+ body.removeChild( container );
+ div = container = null;
+
+ jQuery.extend( support, offsetSupport );
+ });
+
+ return support;
+})();
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var privateCache, thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
+ isEvents = name === "events";
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ internalKey ] = id = ++jQuery.uuid;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // Avoids exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ privateCache = thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Users should not attempt to inspect the internal events object using jQuery.data,
+ // it is undocumented and subject to change. But does anyone listen? No.
+ if ( isEvents && !thisCache[ name ] ) {
+ return privateCache.events;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i, l,
+
+ // Reference to internal data cache key
+ internalKey = jQuery.expando,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ internalKey ] : internalKey;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split( " " );
+ }
+ }
+ }
+
+ for ( i = 0, l = name.length; i < l; i++ ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ // Ensure that `cache` is not a window object #10080
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the cache and need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ internalKey ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( internalKey );
+ } else {
+ elem[ internalKey ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var parts, attr, name,
+ data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
+ attr = this[0].attributes;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ jQuery._data( this[0], "parsedAttrs", true );
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var self = jQuery( this ),
+ args = [ parts[0], value ];
+
+ self.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ self.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ jQuery.isNumeric( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery._data( elem, deferDataKey );
+ if ( defer &&
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery._data( elem, queueDataKey ) &&
+ !jQuery._data( elem, markDataKey ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.fire();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = ( type || "fx" ) + "mark";
+ jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
+ if ( count ) {
+ jQuery._data( elem, key, count );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ var q;
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ q = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ hooks = {};
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ jQuery._data( elem, type + ".run", hooks );
+ fn.call( elem, function() {
+ jQuery.dequeue( elem, type );
+ }, hooks );
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue " + type + ".run", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
+ count++;
+ tmp.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ nodeHook, boolHook, fixSpecified;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = ( value || "" ).split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, i, max, option,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ i = one ? index : 0;
+ max = one ? index + 1 : options.length;
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === "undefined" ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( notxml ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var propName, attrNames, name, l,
+ i = 0;
+
+ if ( value && elem.nodeType === 1 ) {
+ attrNames = value.toLowerCase().split( rspace );
+ l = attrNames.length;
+
+ for ( ; i < l; i++ ) {
+ name = attrNames[ i ];
+
+ if ( name ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ jQuery.attr( elem, name, "" );
+ elem.removeAttribute( getSetAttribute ? name : propName );
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && propName in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return ( elem[ name ] = value );
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
+jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ fixSpecified = {
+ name: true,
+ id: true
+ };
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return ( ret.nodeValue = value + "" );
+ }
+ };
+
+ // Apply the nodeHook to tabindex
+ jQuery.attrHooks.tabindex.set = nodeHook.set;
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ get: nodeHook.get,
+ set: function( elem, value, name ) {
+ if ( value === "" ) {
+ value = "false";
+ }
+ nodeHook.set( elem, value, name );
+ }
+ };
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = "" + value );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ });
+});
+
+
+
+
+var rformElems = /^(?:textarea|input|select)$/i,
+ rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
+ rhoverHack = /\bhover(\.\S+)?\b/,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
+ quickParse = function( selector ) {
+ var quick = rquickIs.exec( selector );
+ if ( quick ) {
+ // 0 1 2 3
+ // [ _, tag, id, class ]
+ quick[1] = ( quick[1] || "" ).toLowerCase();
+ quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
+ }
+ return quick;
+ },
+ quickIs = function( elem, m ) {
+ var attrs = elem.attributes || {};
+ return (
+ (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
+ (!m[2] || (attrs.id || {}).value === m[2]) &&
+ (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
+ );
+ },
+ hoverHack = function( events ) {
+ return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+ };
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var elemData, eventHandle, events,
+ t, tns, type, namespaces, handleObj,
+ handleObjIn, quick, handlers, special;
+
+ // Don't attach events to noData or text/comment nodes (allow plain objects tho)
+ if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ events = elemData.events;
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+ eventHandle = elemData.handle;
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = jQuery.trim( hoverHack(types) ).split( " " );
+ for ( t = 0; t < types.length; t++ ) {
+
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = tns[1];
+ namespaces = ( tns[2] || "" ).split( "." ).sort();
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: tns[1],
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ quick: quickParse( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ handlers = events[ type ];
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ t, tns, type, origType, namespaces, origCount,
+ j, events, special, handle, eventType, handleObj;
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
+ for ( t = 0; t < types.length; t++ ) {
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tns[1];
+ namespaces = tns[2];
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector? special.delegateType : special.bindType ) || type;
+ eventType = events[ type ] || [];
+ origCount = eventType.length;
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+
+ // Remove matching events
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ eventType.splice( j--, 1 );
+
+ if ( handleObj.selector ) {
+ eventType.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( eventType.length === 0 && origCount !== eventType.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery.removeData( elem, [ "events", "handle" ], true );
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Don't do events on text and comment nodes
+ if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
+ return;
+ }
+
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf( "!" ) >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf( "." ) >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.isTrigger = true;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join( "." );
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+ ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
+
+ // Handle a global trigger
+ if ( !elem ) {
+
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ cache = jQuery.cache;
+ for ( i in cache ) {
+ if ( cache[ i ].events && cache[ i ].events[ type ] ) {
+ jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
+ }
+ }
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ eventPath = [[ elem, special.bindType || type ]];
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
+ old = null;
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push([ cur, bubbleType ]);
+ old = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( old && old === elem.ownerDocument ) {
+ eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
+ }
+ }
+
+ // Fire handlers on the event path
+ for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
+
+ cur = eventPath[i][0];
+ event.type = eventPath[i][1];
+
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+ // Note that this is a bare JS function and not a jQuery handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ // IE<9 dies on focus/blur to hidden element (#1486)
+ if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event || window.event );
+
+ var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
+ delegateCount = handlers.delegateCount,
+ args = [].slice.call( arguments, 0 ),
+ run_all = !event.exclusive && !event.namespace,
+ handlerQueue = [],
+ i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Determine handlers that should run if there are delegated events
+ // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
+
+ // Pregenerate a single jQuery object for reuse with .is()
+ jqcur = jQuery(this);
+ jqcur.context = this.ownerDocument || this;
+
+ for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
+ selMatch = {};
+ matches = [];
+ jqcur[0] = cur;
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+ sel = handleObj.selector;
+
+ if ( selMatch[ sel ] === undefined ) {
+ selMatch[ sel ] = (
+ handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
+ );
+ }
+ if ( selMatch[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, matches: matches });
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( handlers.length > delegateCount ) {
+ handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
+ }
+
+ // Run delegates first; they may want to stop propagation beneath us
+ for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
+ matched = handlerQueue[ i ];
+ event.currentTarget = matched.elem;
+
+ for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
+ handleObj = matched.matches[ j ];
+
+ // Triggered event must either 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
+ props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop,
+ originalEvent = event,
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = jQuery.Event( originalEvent );
+
+ for ( i = copy.length; i; ) {
+ prop = copy[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Target should not be a text node (#504, Safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
+ if ( event.metaKey === undefined ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady
+ },
+
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+
+ focus: {
+ delegateType: "focusin"
+ },
+ blur: {
+ delegateType: "focusout"
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ { type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+// Some plugins are using, but it's undocumented/deprecated and will be removed.
+// The 1.7 special event interface should provide all the hooks needed now.
+jQuery.event.handle = jQuery.event.dispatch;
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj,
+ selector = handleObj.selector,
+ ret;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !form._submit_attached ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ });
+ form._submit_attached = true;
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !jQuery.support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ jQuery.event.simulate( "change", this, event, true );
+ }
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ elem._change_attached = true;
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on.call( this, types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ var handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( var type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ live: function( types, data, fn ) {
+ jQuery( this.context ).on( types, this.selector, data, fn );
+ return this;
+ },
+ die: function( types, fn ) {
+ jQuery( this.context ).off( types, this.selector || "**", fn );
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+
+ if ( rkeyEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
+ }
+
+ if ( rmouseEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ expando = "sizcache" + (Math.random() + '').replace('.', ''),
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rReturn = /\r\n/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context, seed );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set, seed );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set, i, len, match, type, left;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ type, found, item, filter, left,
+ i, pass,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ filter = Expr.filter[ type ];
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ pass = not ^ found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Utility function for retreiving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+var getText = Sizzle.getText = function( elem ) {
+ var i, node,
+ nodeType = elem.nodeType,
+ ret = "";
+
+ if ( nodeType ) {
+ if ( nodeType === 1 || nodeType === 9 ) {
+ // Use textContent || innerText for elements
+ if ( typeof elem.textContent === 'string' ) {
+ return elem.textContent;
+ } else if ( typeof elem.innerText === 'string' ) {
+ // Replace IE's carriage returns
+ return elem.innerText.replace( rReturn, '' );
+ } else {
+ // Traverse it's children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ } else {
+
+ // If no nodeType, this is expected to be an array
+ for ( i = 0; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ if ( node.nodeType !== 8 ) {
+ ret += getText( node );
+ }
+ }
+ }
+ return ret;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var first, last,
+ doneName, parent, cache,
+ count, diff,
+ type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ first = match[2];
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ doneName = match[0];
+ parent = elem.parentNode;
+
+ if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
+ count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent[ expando ] = doneName;
+ }
+
+ diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Sizzle.attr ?
+ Sizzle.attr( elem, name ) :
+ Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ !type && Sizzle.attr ?
+ result != null :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context, seed ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet, seed );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+Sizzle.selectors.attrMap = {};
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && (
+ typeof selector === "string" ?
+ // If this is a positional selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ POS.test( selector ) ?
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array (deprecated as of jQuery 1.7)
+ if ( jQuery.isArray( selectors ) ) {
+ var level = 1;
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( i = 0; i < selectors.length; i++ ) {
+
+ if ( jQuery( cur ).is( selectors[ i ] ) ) {
+ ret.push({ selector: selectors[ i ], elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call( arguments ).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( elem === qualifier ) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
+ });
+}
+
+
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style)/i,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ },
+ safeFragment = createSafeFragment( document );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery.clean( arguments );
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery.clean(arguments) );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || ( l > 1 && i < lastIndex ) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc,
+ first = args[ 0 ];
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
+ first.charAt(0) === "<" && !rnocache.test( first ) &&
+ (jQuery.support.checkClone || !rchecked.test( first )) &&
+ (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ first ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ first ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = ( i > 0 ? this.clone(true) : this ).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "input" ) {
+ fixDefaultChecked( elem );
+ // Skip scripts, get other children
+ } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
+function shimCloneNode( elem ) {
+ var div = document.createElement( "div" );
+ safeFragment.appendChild( div );
+
+ div.innerHTML = elem.outerHTML;
+ return div.firstChild;
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var srcElements,
+ destElements,
+ i,
+ // IE<=8 does not properly clone detached, unknown element nodes
+ clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
+ elem.cloneNode( true ) :
+ shimCloneNode( elem );
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Append wrapper element to unknown element safe doc fragment
+ if ( context === document ) {
+ // Use the fragment we've already created for this document
+ safeFragment.appendChild( div );
+ } else {
+ // Use a fragment created with the owner document
+ createSafeFragment( context ).appendChild( div );
+ }
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id,
+ cache = jQuery.cache,
+ special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWH( elem, name, extra );
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ return val;
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat( value );
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( (defaultView = elem.ownerDocument.defaultView) &&
+ (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left, rsLeft, uncomputed,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret === null && style && (uncomputed = style[ name ]) ) {
+ ret = uncomputed;
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ( ret || 0 );
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ which = name === "width" ? cssWidth : cssHeight,
+ i = 0,
+ len = which.length;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ for ( ; i < len; i++ ) {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
+ }
+ }
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ] || 0;
+ }
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ for ( ; i < len; i++ ) {
+ val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
+ }
+ }
+ }
+
+ return val + "px";
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts,
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for ( ; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for ( ; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.on( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ statusText = nativeStatusText,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.add;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for ( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for ( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for ( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for ( key in s.converters ) {
+ if ( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if ( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for ( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback );
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css(elem, "display") === "none" ) {
+ jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ var elem, display,
+ i = 0,
+ j = this.length;
+
+ for ( ; i < j; i++ ) {
+ elem = this[i];
+ if ( elem.style ) {
+ display = jQuery.css( elem, "display" );
+
+ if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
+ jQuery._data( elem, "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed( speed, easing, callback );
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ function doAnimation() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p, e,
+ parts, start, end, unit,
+ method;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test( val ) ) {
+
+ // Tracks whether to show or hide based on private
+ // data attached to the element
+ method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
+ if ( method ) {
+ jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
+ e[ method ]();
+ } else {
+ e[ val ]();
+ }
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ( (end || 1) / e.cur() ) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ }
+
+ return optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+
+ stop: function( type, clearQueue, gotoEnd ) {
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var index,
+ hadTimers = false,
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+
+ function stopQueue( elem, data, index ) {
+ var hooks = data[ index ];
+ jQuery.removeData( elem, index, true );
+ hooks.stop( gotoEnd );
+ }
+
+ if ( type == null ) {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
+ stopQueue( this, data, index );
+ }
+ }
+ } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
+ stopQueue( this, data, index );
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ if ( gotoEnd ) {
+
+ // force the next step to be the last
+ timers[ index ]( true );
+ } else {
+ timers[ index ].saveState();
+ }
+ hadTimers = true;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( !( gotoEnd && hadTimers ) ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx( "show", 1 ),
+ slideUp: genFx( "hide", 1 ),
+ slideToggle: genFx( "toggle", 1 ),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx;
+
+ this.startTime = fxNow || createFxNow();
+ this.end = to;
+ this.now = this.start = from;
+ this.pos = this.state = 0;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+
+ function t( gotoEnd ) {
+ return self.step( gotoEnd );
+ }
+
+ t.queue = this.options.queue;
+ t.elem = this.elem;
+ t.saveState = function() {
+ if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
+ jQuery._data( self.elem, "fxshow" + self.prop, self.start );
+ }
+ };
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
+
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any flash of content
+ if ( dataShow !== undefined ) {
+ // This show is picking up where a previous hide or show left off
+ this.custom( this.cur(), dataShow );
+ } else {
+ this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
+ }
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom( this.cur(), 0 );
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var p, n, complete,
+ t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( p in options.animatedProperties ) {
+ if ( options.animatedProperties[ p ] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function( index, value ) {
+ elem.style[ "overflow" + value ] = options.overflow[ index ];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery( elem ).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[ p ] );
+ jQuery.removeData( elem, "fxshow" + p, true );
+ // Toggle data is no longer needed
+ jQuery.removeData( elem, "toggle" + p, true );
+ }
+ }
+
+ // Execute the complete function
+ // in the event that the complete function throws an exception
+ // we must ensure it won't be called twice. #5684
+
+ complete = options.complete;
+ if ( complete ) {
+
+ options.complete = false;
+ complete.call( elem );
+ }
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ( (this.end - this.start) * this.pos );
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+// Adds width/height step functions
+// Do not set anything below 0
+jQuery.each([ "width", "height" ], function( i, prop ) {
+ jQuery.fx.step[ prop ] = function( fx ) {
+ jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
+ };
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ],
+ body = elem.document.body;
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ body && body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNumeric( ret ) ? ret : orig;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+// Expose jQuery as an AMD module, but only for AMD loaders that
+// understand the issues with loading multiple versions of jQuery
+// in a page that all might call define(). The loader will indicate
+// they have special allowances for multiple jQuery versions by
+// specifying define.amd.jQuery = true. Register as a named module,
+// since jQuery can be concatenated with other files that may use define,
+// but not use a proper concatenation script that understands anonymous
+// AMD modules. A named AMD is safest and most robust way to register.
+// Lowercase jquery is used because AMD module names are derived from
+// file names, and jQuery is normally delivered in a lowercase file name.
+// Do this after creating the global so that if an AMD module wants to call
+// noConflict to hide this version of jQuery, it will work.
+if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
+ define( "jquery", [], function () { return jQuery; } );
+}
+
+
+
+})( window );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.js
new file mode 100644
index 0000000..eda55db
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.js
@@ -0,0 +1,9300 @@
+/*!
+ * jQuery JavaScript Library v1.7
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Nov 3 16:18:21 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = ( context ? context.ownerDocument || context : document );
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.7",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.add( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.fireWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery.Callbacks( "once memory" );
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNumeric: function( obj ) {
+ return obj != null && rdigit.test( obj ) && !isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array, i ) {
+ var len;
+
+ if ( array ) {
+ if ( indexOf ) {
+ return indexOf.call( array, elem, i );
+ }
+
+ len = array.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in array && array[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+// Expose jQuery as an AMD module, but only for AMD loaders that
+// understand the issues with loading multiple versions of jQuery
+// in a page that all might call define(). The loader will indicate
+// they have special allowances for multiple jQuery versions by
+// specifying define.amd.jQuery = true. Register as a named module,
+// since jQuery can be concatenated with other files that may use define,
+// but not use a proper concatenation script that understands anonymous
+// AMD modules. A named AMD is safest and most robust way to register.
+// Lowercase jquery is used because AMD module names are derived from
+// file names, and jQuery is normally delivered in a lowercase file name.
+if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
+ define( "jquery", [], function () { return jQuery; } );
+}
+
+return jQuery;
+
+})();
+
+
+// String to Object flags format cache
+var flagsCache = {};
+
+// Convert String-formatted flags into Object-formatted ones and store in cache
+function createFlags( flags ) {
+ var object = flagsCache[ flags ] = {},
+ i, length;
+ flags = flags.split( /\s+/ );
+ for ( i = 0, length = flags.length; i < length; i++ ) {
+ object[ flags[i] ] = true;
+ }
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * flags: an optional list of space-separated flags that will change how
+ * the callback list behaves
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible flags:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( flags ) {
+
+ // Convert flags from String-formatted to Object-formatted
+ // (we check in cache first)
+ flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+
+ var // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = [],
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Add one or several callbacks to the list
+ add = function( args ) {
+ var i,
+ length,
+ elem,
+ type,
+ actual;
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ // Inspect recursively
+ add( elem );
+ } else if ( type === "function" ) {
+ // Add if not in unique mode and callback is not in
+ if ( !flags.unique || !self.has( elem ) ) {
+ list.push( elem );
+ }
+ }
+ }
+ },
+ // Fire callbacks
+ fire = function( context, args ) {
+ args = args || [];
+ memory = !flags.memory || [ context, args ];
+ firing = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
+ memory = true; // Mark as halted
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( !flags.once ) {
+ if ( stack && stack.length ) {
+ memory = stack.shift();
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
+ }
+ } else if ( memory === true ) {
+ self.disable();
+ } else {
+ list = [];
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ var length = list.length;
+ add( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away, unless previous
+ // firing was halted (stopOnFalse)
+ } else if ( memory && memory !== true ) {
+ firingStart = length;
+ fire( memory[ 0 ], memory[ 1 ] );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ var args = arguments,
+ argIndex = 0,
+ argLength = args.length;
+ for ( ; argIndex < argLength ; argIndex++ ) {
+ for ( var i = 0; i < list.length; i++ ) {
+ if ( args[ argIndex ] === list[ i ] ) {
+ // Handle firingIndex and firingLength
+ if ( firing ) {
+ if ( i <= firingLength ) {
+ firingLength--;
+ if ( i <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ // Remove the element
+ list.splice( i--, 1 );
+ // If we have some unicity property then
+ // we only need to do this once
+ if ( flags.unique ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+ return this;
+ },
+ // Control if a given callback is in the list
+ has: function( fn ) {
+ if ( list ) {
+ var i = 0,
+ length = list.length;
+ for ( ; i < length; i++ ) {
+ if ( fn === list[ i ] ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory || memory === true ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( stack ) {
+ if ( firing ) {
+ if ( !flags.once ) {
+ stack.push( [ context, args ] );
+ }
+ } else if ( !( flags.once && memory ) ) {
+ fire( context, args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!memory;
+ }
+ };
+
+ return self;
+};
+
+
+
+
+var // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var doneList = jQuery.Callbacks( "once memory" ),
+ failList = jQuery.Callbacks( "once memory" ),
+ progressList = jQuery.Callbacks( "memory" ),
+ state = "pending",
+ lists = {
+ resolve: doneList,
+ reject: failList,
+ notify: progressList
+ },
+ promise = {
+ done: doneList.add,
+ fail: failList.add,
+ progress: progressList.add,
+
+ state: function() {
+ return state;
+ },
+
+ // Deprecated
+ isResolved: doneList.fired,
+ isRejected: failList.fired,
+
+ then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
+ return this;
+ },
+ always: function() {
+ return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
+ },
+ pipe: function( fnDone, fnFail, fnProgress ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ],
+ progress: [ fnProgress, "notify" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ obj = promise;
+ } else {
+ for ( var key in promise ) {
+ obj[ key ] = promise[ key ];
+ }
+ }
+ return obj;
+ }
+ },
+ deferred = promise.promise({}),
+ key;
+
+ for ( key in lists ) {
+ deferred[ key ] = lists[ key ].fire;
+ deferred[ key + "With" ] = lists[ key ].fireWith;
+ }
+
+ // Handle state
+ deferred.done( function() {
+ state = "resolved";
+ }, failList.disable, progressList.lock ).fail( function() {
+ state = "rejected";
+ }, doneList.disable, progressList.lock );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = sliceDeferred.call( arguments, 0 ),
+ i = 0,
+ length = args.length,
+ pValues = new Array( length ),
+ count = length,
+ pCount = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred(),
+ promise = deferred.promise();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ deferred.resolveWith( deferred, args );
+ }
+ };
+ }
+ function progressFunc( i ) {
+ return function( value ) {
+ pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ deferred.notifyWith( promise, pValues );
+ };
+ }
+ if ( length > 1 ) {
+ for ( ; i < length; i++ ) {
+ if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return promise;
+ }
+});
+
+
+
+
+jQuery.support = (function() {
+
+ var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ marginDiv,
+ support,
+ fragment,
+ body,
+ testElementParent,
+ testElement,
+ testElementStyle,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>";
+
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName( "tbody" ).length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure unknown elements (like HTML5 elems) are handled appropriately
+ unknownElems: !!div.getElementsByTagName( "nav" ).length,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Tests for enctype support on a form(#6743)
+ enctype: !!document.createElement("form").enctype,
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains its value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.lastChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ div.innerHTML = "";
+
+ // Figure out if the W3C box model works as expected
+ div.style.width = div.style.paddingLeft = "1px";
+
+ // We don't want to do body-related feature tests on frameset
+ // documents, which lack a body. So we use
+ // document.getElementsByTagName("body")[0], which is undefined in
+ // frameset documents, while document.body isn’t. (7398)
+ body = document.getElementsByTagName("body")[ 0 ];
+ // We use our own, invisible, body unless the body is already present
+ // in which case we use a div (#9239)
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ jQuery.extend( testElementStyle, {
+ position: "absolute",
+ left: "-999px",
+ top: "-999px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "<div style='width:4px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+ }
+
+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+ div.innerHTML = "";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ // Technique from Juriy Zaytsev
+ // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ } ) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ // Run fixed position tests at doc ready to avoid a crash
+ // related to the invisible body in IE8
+ jQuery(function() {
+ var container, outer, inner, table, td, offsetSupport,
+ conMarginTop = 1,
+ ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
+ vb = "visibility:hidden;border:0;",
+ style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
+ html = "<div " + style + "><div></div></div>" +
+ "<table " + style + " cellpadding='0' cellspacing='0'>" +
+ "<tr><td></td></tr></table>";
+
+ // Reconstruct a container
+ body = document.getElementsByTagName("body")[0];
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ // These tests cannot be done
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
+ body.insertBefore( container, body.firstChild );
+
+ // Construct a test element
+ testElement = document.createElement("div");
+ testElement.style.cssText = ptlm + vb;
+
+ testElement.innerHTML = html;
+ container.appendChild( testElement );
+ outer = testElement.firstChild;
+ inner = outer.firstChild;
+ td = outer.nextSibling.firstChild.firstChild;
+
+ offsetSupport = {
+ doesNotAddBorder: ( inner.offsetTop !== 5 ),
+ doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
+ };
+
+ inner.style.position = "fixed";
+ inner.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
+ inner.style.position = inner.style.top = "";
+
+ outer.style.overflow = "hidden";
+ outer.style.position = "relative";
+
+ offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
+ offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
+
+ body.removeChild( container );
+ testElement = container = null;
+
+ jQuery.extend( support, offsetSupport );
+ });
+
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+
+ // Null connected elements to avoid leaks in IE
+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
+
+ return support;
+})();
+
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var privateCache, thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando,
+ isEvents = name === "events";
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ } else {
+ id = jQuery.expando;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // Avoids exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ privateCache = thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Users should not attempt to inspect the internal events object using jQuery.data,
+ // it is undocumented and subject to change. But does anyone listen? No.
+ if ( isEvents && !thisCache[ name ] ) {
+ return privateCache.events;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i, l,
+
+ // Reference to internal data cache key
+ internalKey = jQuery.expando,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support space separated names
+ if ( jQuery.isArray( name ) ) {
+ name = name;
+ } else if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split( " " );
+ }
+ }
+
+ for ( i = 0, l = name.length; i < l; i++ ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ // Ensure that `cache` is not a window object #10080
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the cache and need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ } else {
+ elem[ jQuery.expando ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var parts, attr, name,
+ data = null;
+
+ if ( typeof key === "undefined" ) {
+ if ( this.length ) {
+ data = jQuery.data( this[0] );
+
+ if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
+ attr = this[0].attributes;
+ for ( var i = 0, l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( this[0], name, data[ name ] );
+ }
+ }
+ jQuery._data( this[0], "parsedAttrs", true );
+ }
+ }
+
+ return data;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ data = dataAttr( this[0], key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ),
+ args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ jQuery.isNumeric( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery._data( elem, deferDataKey );
+ if ( defer &&
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery._data( elem, queueDataKey ) &&
+ !jQuery._data( elem, markDataKey ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.fire();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = ( type || "fx" ) + "mark";
+ jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
+ if ( count ) {
+ jQuery._data( elem, key, count );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ var q;
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ q = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ hooks = {};
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ jQuery._data( elem, type + ".run", hooks );
+ fn.call( elem, function() {
+ jQuery.dequeue( elem, type );
+ }, hooks );
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue " + type + ".run", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
+ count++;
+ tmp.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise();
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ nodeHook, boolHook, fixSpecified;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.prop );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = ( value || "" ).split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return undefined;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, i, max, option,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ i = one ? index : 0;
+ max = one ? index + 1 : options.length;
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( notxml ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return undefined;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var propName, attrNames, name, l,
+ i = 0;
+
+ if ( elem.nodeType === 1 ) {
+ attrNames = ( value || "" ).split( rspace );
+ l = attrNames.length;
+
+ for ( ; i < l; i++ ) {
+ name = attrNames[ i ].toLowerCase();
+ propName = jQuery.propFix[ name ] || name;
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ jQuery.attr( elem, name, "" );
+ elem.removeAttribute( getSetAttribute ? name : propName );
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && propName in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ 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( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return undefined;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return ( elem[ name ] = value );
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
+jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ fixSpecified = {
+ name: true,
+ id: true
+ };
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return ( ret.nodeValue = value + "" );
+ }
+ };
+
+ // Apply the nodeHook to tabindex
+ jQuery.attrHooks.tabindex.set = nodeHook.set;
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ get: nodeHook.get,
+ set: function( elem, value, name ) {
+ if ( value === "" ) {
+ value = "false";
+ }
+ nodeHook.set( elem, value, name );
+ }
+ };
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = "" + value );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ });
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspaces = / /g,
+ rescape = /[^\w\s.|`]/g,
+ rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
+ rhoverHack = /\bhover(\.\S+)?/,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
+ quickParse = function( selector ) {
+ var quick = rquickIs.exec( selector );
+ if ( quick ) {
+ // 0 1 2 3
+ // [ _, tag, id, class ]
+ quick[1] = ( quick[1] || "" ).toLowerCase();
+ quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
+ }
+ return quick;
+ },
+ quickIs = function( elem, m ) {
+ return (
+ (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
+ (!m[2] || elem.id === m[2]) &&
+ (!m[3] || m[3].test( elem.className ))
+ );
+ },
+ hoverHack = function( events ) {
+ return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+ };
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var elemData, eventHandle, events,
+ t, tns, type, namespaces, handleObj,
+ handleObjIn, quick, handlers, special;
+
+ // Don't attach events to noData or text/comment nodes (allow plain objects tho)
+ if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ events = elemData.events;
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+ eventHandle = elemData.handle;
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = hoverHack(types).split( " " );
+ for ( t = 0; t < types.length; t++ ) {
+
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = tns[1];
+ namespaces = ( tns[2] || "" ).split( "." ).sort();
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: tns[1],
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Delegated event; pre-analyze selector so it's processed quickly on event dispatch
+ if ( selector ) {
+ handleObj.quick = quickParse( selector );
+ if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) {
+ handleObj.isPositional = true;
+ }
+ }
+
+ // Init the event handler queue if we're the first
+ handlers = events[ type ];
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector ) {
+
+ var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ t, tns, type, namespaces, origCount,
+ j, events, special, handle, eventType, handleObj;
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = hoverHack( types || "" ).split(" ");
+ for ( t = 0; t < types.length; t++ ) {
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = tns[1];
+ namespaces = tns[2];
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ namespaces = namespaces? "." + namespaces : "";
+ for ( j in events ) {
+ jQuery.event.remove( elem, j + namespaces, handler, selector );
+ }
+ return;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector? special.delegateType : special.bindType ) || type;
+ eventType = events[ type ] || [];
+ origCount = eventType.length;
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+
+ // Only need to loop for special events or selective removal
+ if ( handler || namespaces || selector || special.remove ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( !handler || handler.guid === handleObj.guid ) {
+ if ( !namespaces || namespaces.test( handleObj.namespace ) ) {
+ if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) {
+ eventType.splice( j--, 1 );
+
+ if ( handleObj.selector ) {
+ eventType.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+ }
+ }
+ } else {
+ // Removing all events
+ eventType.length = 0;
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( eventType.length === 0 && origCount !== eventType.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery.removeData( elem, [ "events", "handle" ], true );
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Don't do events on text and comment nodes
+ if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
+ return;
+ }
+
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
+
+ if ( type.indexOf( "!" ) >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf( "." ) >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.isTrigger = true;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join( "." );
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+ ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
+
+ // triggerHandler() and global events don't bubble or run the default action
+ if ( onlyHandlers || !elem ) {
+ event.preventDefault();
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ cache = jQuery.cache;
+ for ( i in cache ) {
+ if ( cache[ i ].events && cache[ i ].events[ type ] ) {
+ jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
+ }
+ }
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ eventPath = [[ elem, special.bindType || type ]];
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ old = null;
+ for ( cur = elem.parentNode; cur; cur = cur.parentNode ) {
+ eventPath.push([ cur, bubbleType ]);
+ old = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( old && old === elem.ownerDocument ) {
+ eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
+ }
+ }
+
+ // Fire handlers on the event path
+ for ( i = 0; i < eventPath.length; i++ ) {
+
+ cur = eventPath[i][0];
+ event.type = eventPath[i][1];
+
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) ) {
+ handle.apply( cur, data );
+ }
+
+ if ( event.isPropagationStopped() ) {
+ break;
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ // IE<9 dies on focus/blur to hidden element (#1486)
+ if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event || window.event );
+
+ var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
+ delegateCount = handlers.delegateCount,
+ args = [].slice.call( arguments, 0 ),
+ run_all = !event.exclusive && !event.namespace,
+ specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle,
+ handlerQueue = [],
+ i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related;
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Determine handlers that should run if there are delegated events
+ // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
+
+ for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
+ selMatch = {};
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+ sel = handleObj.selector;
+ hit = selMatch[ sel ];
+
+ if ( handleObj.isPositional ) {
+ // Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/
+ hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0;
+ } else if ( hit === undefined ) {
+ hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) );
+ }
+ if ( hit ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, matches: matches });
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( handlers.length > delegateCount ) {
+ handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
+ }
+
+ // Run delegates first; they may want to stop propagation beneath us
+ for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
+ matched = handlerQueue[ i ];
+ event.currentTarget = matched.elem;
+
+ for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
+ handleObj = matched.matches[ j ];
+
+ // Triggered event must either 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
+ props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop,
+ originalEvent = event,
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = jQuery.Event( originalEvent );
+
+ for ( i = copy.length; i; ) {
+ prop = copy[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Target should not be a text node (#504, Safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
+ if ( event.metaKey === undefined ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady
+ },
+
+ focus: {
+ delegateType: "focusin",
+ noBubble: true
+ },
+ blur: {
+ delegateType: "focusout",
+ noBubble: true
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ { type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+// Some plugins are using, but it's undocumented/deprecated and will be removed.
+// The 1.7 special event interface should provide all the hooks needed now.
+jQuery.event.handle = jQuery.event.dispatch;
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj,
+ selector = handleObj.selector,
+ oldType, ret;
+
+ // For a real mouseover/out, always call the handler; for
+ // mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
+ oldType = event.type;
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = oldType;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !form._submit_attached ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ // Form was submitted, bubble the event up the tree
+ if ( this.parentNode ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ });
+ form._submit_attached = true;
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !jQuery.support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed ) {
+ this._just_changed = false;
+ jQuery.event.simulate( "change", this, event, true );
+ }
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ elem._change_attached = true;
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on.call( this, types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ var handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( var type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ live: function( types, data, fn ) {
+ jQuery( this.context ).on( types, this.selector, data, fn );
+ return this;
+ },
+ die: function( types, fn ) {
+ jQuery( this.context ).off( types, this.selector || "**", fn );
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+
+ if ( rkeyEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
+ }
+
+ if ( rmouseEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ expando = "sizcache" + (Math.random() + '').replace('.', ''),
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rReturn = /\r\n/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context, seed );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set, seed );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set, i, len, match, type, left;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ type, found, item, filter, left,
+ i, pass,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ filter = Expr.filter[ type ];
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ pass = not ^ found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+/**
+ * Utility function for retreiving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+var getText = Sizzle.getText = function( elem ) {
+ var i, node,
+ nodeType = elem.nodeType,
+ ret = "";
+
+ if ( nodeType ) {
+ if ( nodeType === 1 ) {
+ // Use textContent || innerText for elements
+ if ( typeof elem.textContent === 'string' ) {
+ return elem.textContent;
+ } else if ( typeof elem.innerText === 'string' ) {
+ // Replace IE's carriage returns
+ return elem.innerText.replace( rReturn, '' );
+ } else {
+ // Traverse it's children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ } else {
+
+ // If no nodeType, this is expected to be an array
+ for ( i = 0; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ if ( node.nodeType !== 8 ) {
+ ret += getText( node );
+ }
+ }
+ }
+ return ret;
+};
+
+var Expr = Sizzle.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( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var first, last,
+ doneName, parent, cache,
+ count, diff,
+ type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ first = match[2];
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ doneName = match[0];
+ parent = elem.parentNode;
+
+ if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
+ count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent[ expando ] = doneName;
+ }
+
+ diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Sizzle.attr ?
+ Sizzle.attr( elem, name ) :
+ Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ !type && Sizzle.attr ?
+ result != null :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context, seed ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet, seed );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+Sizzle.selectors.attrMap = {};
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && (
+ typeof selector === "string" ?
+ // If this is a positional selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ POS.test( selector ) ?
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array (deprecated as of jQuery 1.7)
+ if ( jQuery.isArray( selectors ) ) {
+ var level = 1;
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( i = 0; i < selectors.length; i++ ) {
+
+ if ( jQuery( cur ).is( selectors[ i ] ) ) {
+ ret.push({ selector: selectors[ i ], elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until ),
+ // The variable 'args' was introduced in
+ // https://github.com/jquery/jquery/commit/52a0238
+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+ // http://code.google.com/p/v8/issues/detail?id=1050
+ args = slice.call(arguments);
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, args.join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( elem === qualifier ) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
+ });
+}
+
+
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( " " ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " +
+ "header hgroup mark meter nav output progress section summary time video",
+ rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style)/i,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ rnoshimcache = new RegExp("<(?:" + nodeNames.replace(" ", "|") + ")", "i"),
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ 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, "", "" ]
+ },
+ safeFragment = createSafeFragment( document );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery( this );
+
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, "<$1></$2>");
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery( this );
+
+ self.html( value.call(this, i, self.html()) );
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || ( l > 1 && i < lastIndex ) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc,
+ first = args[ 0 ];
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
+ first.charAt(0) === "<" && !rnocache.test( first ) &&
+ (jQuery.support.checkClone || !rchecked.test( first )) &&
+ (!jQuery.support.unknownElems && rnoshimcache.test( first )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ first ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ first ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = ( i > 0 ? this.clone(true) : this ).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "input" ) {
+ fixDefaultChecked( elem );
+ // Skip scripts, get other children
+ } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var clone = elem.cloneNode(true),
+ srcElements,
+ destElements,
+ i;
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
+ // instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType;
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [], j;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Append wrapper element to unknown element safe doc fragment
+ if ( context === document ) {
+ // Use the fragment we've already created for this document
+ safeFragment.appendChild( div );
+ } else {
+ // Use a fragment created with the owner document
+ createSafeFragment( context ).appendChild( div );
+ }
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id,
+ cache = jQuery.cache,
+ special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ });
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ var val;
+
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWH( elem, name, extra );
+ } else {
+ jQuery.swap( elem, cssShow, function() {
+ val = getWH( elem, name, extra );
+ });
+ }
+
+ return val;
+ }
+ },
+
+ set: function( elem, value ) {
+ if ( rnumpx.test( value ) ) {
+ // ignore negative width and height values #1599
+ value = parseFloat( value );
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
+ }
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
+ ret = elem.style.marginRight;
+ }
+ });
+ return ret;
+ }
+ };
+ }
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+ return undefined;
+ }
+
+ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left, rsLeft, uncomputed,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret === null && style && (uncomputed = style[ name ]) ) {
+ ret = uncomputed;
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ( ret || 0 );
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ which = name === "width" ? cssWidth : cssHeight;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ] || 0;
+ }
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ jQuery.each( which, function() {
+ val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+ }
+ });
+ }
+
+ return val + "px";
+}
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts,
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for ( ; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for ( ; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.bind( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ statusText = nativeStatusText,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.add;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for ( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefiler, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ jQuery.error( e );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for ( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for ( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for ( key in s.converters ) {
+ if ( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if ( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for ( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+ ( typeof s.data === "string" );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback );
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( display === "" && jQuery.css(elem, "display") === "none" ) {
+ jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ var elem, display,
+ i = 0,
+ j = this.length;
+
+ for ( ; i < j; i++ ) {
+ elem = this[i];
+ if ( elem.style ) {
+ display = jQuery.css( elem, "display" );
+
+ if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
+ jQuery._data( elem, "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed( speed, easing, callback );
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ function doAnimation() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p, e,
+ parts, start, end, unit,
+ method;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ for ( p in prop ) {
+
+ // property name normalization
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ val = prop[ name ];
+
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test( val ) ) {
+
+ // Tracks whether to show or hide based on private
+ // data attached to the element
+ method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
+ if ( method ) {
+ jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
+ e[ method ]();
+ } else {
+ e[ val ]();
+ }
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ( (end || 1) / e.cur() ) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ }
+
+ return optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+
+ stop: function( type, clearQueue, gotoEnd ) {
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var i,
+ hadTimers = false,
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+
+ function stopQueue( elem, data, i ) {
+ var hooks = data[ i ];
+ jQuery.removeData( elem, i, true );
+ hooks.stop( gotoEnd );
+ }
+
+ if ( type == null ) {
+ for ( i in data ) {
+ if ( data[ i ].stop && i.indexOf(".run") === i.length - 4 ) {
+ stopQueue( this, data, i );
+ }
+ }
+ } else if ( data[ i = type + ".run" ] && data[ i ].stop ){
+ stopQueue( this, data, i );
+ }
+
+ for ( i = timers.length; i--; ) {
+ if ( timers[ i ].elem === this && (type == null || timers[ i ].queue === type) ) {
+ if ( gotoEnd ) {
+
+ // force the next step to be the last
+ timers[ i ]( true );
+ } else {
+ timers[ i ].saveState();
+ }
+ hadTimers = true;
+ timers.splice( i, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( !( gotoEnd && hadTimers ) ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx( "show", 1 ),
+ slideUp: genFx( "hide", 1 ),
+ slideToggle: genFx( "toggle", 1 ),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx;
+
+ this.startTime = fxNow || createFxNow();
+ this.end = to;
+ this.now = this.start = from;
+ this.pos = this.state = 0;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+
+ function t( gotoEnd ) {
+ return self.step( gotoEnd );
+ }
+
+ t.queue = this.options.queue;
+ t.elem = this.elem;
+ t.saveState = function() {
+ if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
+ jQuery._data( self.elem, "fxshow" + self.prop, self.start );
+ }
+ };
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
+
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any flash of content
+ if ( dataShow !== undefined ) {
+ // This show is picking up where a previous hide or show left off
+ this.custom( this.cur(), dataShow );
+ } else {
+ this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
+ }
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom( this.cur(), 0 );
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var p, n, complete,
+ t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( p in options.animatedProperties ) {
+ if ( options.animatedProperties[ p ] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function( index, value ) {
+ elem.style[ "overflow" + value ] = options.overflow[ index ];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery( elem ).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[ p ] );
+ jQuery.removeData( elem, "fxshow" + p, true );
+ // Toggle data is no longer needed
+ jQuery.removeData( elem, "toggle" + p, true );
+ }
+ }
+
+ // Execute the complete function
+ // in the event that the complete function throws an exception
+ // we must ensure it won't be called twice. #5684
+
+ complete = options.complete;
+ if ( complete ) {
+
+ options.complete = false;
+ complete.call( elem );
+ }
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ( (this.end - this.start) * this.pos );
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+// Adds width/height step functions
+// Do not set anything below 0
+jQuery.each([ "width", "height" ], function( i, prop ) {
+ jQuery.fx.step[ prop ] = function( fx ) {
+ jQuery.style( fx.elem, prop, Math.max(0, fx.now) );
+ };
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0], box;
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ var doc = elem.ownerDocument,
+ docElem = doc.documentElement;
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow(doc),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ doc = elem.ownerDocument,
+ docElem = doc.documentElement,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function( val ) {
+ var elem, win;
+
+ if ( val === undefined ) {
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return null;
+ }
+
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ if ( jQuery.isWindow( elem ) ) {
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ var docElemProp = elem.document.documentElement[ "client" + name ],
+ body = elem.document.body;
+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+ body && body[ "client" + name ] || docElemProp;
+
+ // Get document width or height
+ } else if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ return Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ );
+
+ // Get or set width or height on the element
+ } else if ( size === undefined ) {
+ var orig = jQuery.css( elem, type ),
+ ret = parseFloat( orig );
+
+ return jQuery.isNumeric( ret ) ? ret : orig;
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ } else {
+ return this.css( type, typeof size === "string" ? size : size + "px" );
+ }
+ };
+
+});
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+})( window );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.js
new file mode 100644
index 0000000..101f9bb
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.js
@@ -0,0 +1,26 @@
+(function() {
+
+var parts = document.location.search.slice( 1 ).split( "&" ),
+ length = parts.length,
+ i = 0,
+ current,
+ version,
+ url;
+
+for ( ; i < length; i++ ) {
+ current = parts[ i ].split( "=" );
+ if ( current[ 0 ] === "jquery" ) {
+ version = current[ 1 ];
+ break;
+ }
+}
+
+if ( version === "git" ) {
+ url = "http://code.jquery.com/jquery-git.js";
+} else {
+ url = "../../jquery-" + ( version || "1.7.1" ) + ".js";
+}
+
+document.write( "<script src='" + url + "'></script>" );
+
+}() );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js
new file mode 100644
index 0000000..a37302c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js
@@ -0,0 +1,234 @@
+/*
+ * jquery.simulate - simulate browser mouse and keyboard events
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ */
+
+;(function( $ ) {
+
+$.fn.extend({
+ simulate: function( type, options ) {
+ return this.each(function() {
+ var opt = $.extend( {}, $.simulate.defaults, options );
+ new $.simulate( this, type, opt );
+ });
+ }
+});
+
+$.simulate = function( el, type, options ) {
+ this.target = el;
+ this.options = options;
+
+ if ( type === "drag" ) {
+ this[ type ].apply( this, [ this.target, options ] );
+ } else if ( type === "focus" || type === "blur" ) {
+ this[ type ]();
+ } else {
+ this.simulateEvent( el, type, options );
+ }
+};
+
+$.extend( $.simulate.prototype, {
+ simulateEvent: function( el, type, options ) {
+ var evt = this.createEvent( type, options );
+ this.dispatchEvent( el, type, evt, options );
+ return evt;
+ },
+ createEvent: function( type, options ) {
+ if ( /^mouse(over|out|down|up|move)|(dbl)?click$/.test( type ) ) {
+ return this.mouseEvent( type, options );
+ } else if ( /^key(up|down|press)$/.test( type ) ) {
+ return this.keyboardEvent( type, options );
+ }
+ },
+ mouseEvent: function( type, options ) {
+ var evt;
+ var e = $.extend({
+ bubbles: true,
+ cancelable: (type !== "mousemove"),
+ view: window,
+ detail: 0,
+ screenX: 0,
+ screenY: 0,
+ clientX: 0,
+ clientY: 0,
+ ctrlKey: false,
+ altKey: false,
+ shiftKey: false,
+ metaKey: false,
+ button: 0,
+ relatedTarget: undefined
+ }, options );
+
+ var relatedTarget = $( e.relatedTarget )[0];
+
+ if ( $.isFunction( document.createEvent ) ) {
+ evt = document.createEvent( "MouseEvents" );
+ evt.initMouseEvent( type, e.bubbles, e.cancelable, e.view, e.detail,
+ e.screenX, e.screenY, e.clientX, e.clientY,
+ e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
+ e.button, e.relatedTarget || document.body.parentNode );
+ } else if ( document.createEventObject ) {
+ evt = document.createEventObject();
+ $.extend( evt, e );
+ evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button;
+ }
+ return evt;
+ },
+ keyboardEvent: function( type, options ) {
+ var evt;
+
+ var e = $.extend({
+ bubbles: true,
+ cancelable: true,
+ view: window,
+ ctrlKey: false,
+ altKey: false,
+ shiftKey: false,
+ metaKey: false,
+ keyCode: 0,
+ charCode: undefined
+ }, options );
+
+ if ( $.isFunction( document.createEvent ) ) {
+ try {
+ evt = document.createEvent( "KeyEvents" );
+ evt.initKeyEvent( type, e.bubbles, e.cancelable, e.view,
+ e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
+ e.keyCode, e.charCode );
+ } catch( err ) {
+ evt = document.createEvent( "Events" );
+ evt.initEvent( type, e.bubbles, e.cancelable );
+ $.extend(evt, {
+ view: e.view,
+ ctrlKey: e.ctrlKey,
+ altKey: e.altKey,
+ shiftKey: e.shiftKey,
+ metaKey: e.metaKey,
+ keyCode: e.keyCode,
+ charCode: e.charCode
+ });
+ }
+ } else if ( document.createEventObject ) {
+ evt = document.createEventObject();
+ $.extend( evt, e );
+ }
+ if ( $.browser.msie || $.browser.opera ) {
+ evt.keyCode = (e.charCode > 0) ? e.charCode : e.keyCode;
+ evt.charCode = undefined;
+ }
+ return evt;
+ },
+
+ dispatchEvent: function( el, type, evt ) {
+ if ( el.dispatchEvent ) {
+ el.dispatchEvent( evt );
+ } else if ( el.fireEvent ) {
+ el.fireEvent( "on" + type, evt );
+ }
+ return evt;
+ },
+
+ drag: function( el ) {
+ var self = this,
+ center = this.findCenter(this.target),
+ options = this.options,
+ x = Math.floor( center.x ),
+ y = Math.floor( center.y ),
+ dx = options.dx || 0,
+ dy = options.dy || 0,
+ target = this.target,
+ coord = { clientX: x, clientY: y };
+ this.simulateEvent( target, "mousedown", coord );
+ coord = { clientX: x + 1, clientY: y + 1 };
+ this.simulateEvent( document, "mousemove", coord );
+ coord = { clientX: x + dx, clientY: y + dy };
+ this.simulateEvent( document, "mousemove", coord );
+ this.simulateEvent( document, "mousemove", coord );
+ this.simulateEvent( target, "mouseup", coord );
+ this.simulateEvent( target, "click", coord );
+ },
+ findCenter: function( el ) {
+ var el = $( this.target ),
+ o = el.offset(),
+ d = $( document );
+ return {
+ x: o.left + el.outerWidth() / 2 - d.scrollLeft(),
+ y: o.top + el.outerHeight() / 2 - d.scrollTop()
+ };
+ },
+
+ focus: function() {
+ var focusinEvent,
+ triggered = false,
+ element = $( this.target );
+
+ function trigger() {
+ triggered = true;
+ }
+
+ element.bind( "focus", trigger );
+ element[ 0 ].focus();
+
+ if ( !triggered ) {
+ focusinEvent = $.Event( "focusin" );
+ focusinEvent.preventDefault();
+ element.trigger( focusinEvent );
+ element.triggerHandler( "focus" );
+ }
+ element.unbind( "focus", trigger );
+ },
+
+ blur: function() {
+ var focusoutEvent,
+ triggered = false,
+ element = $( this.target );
+
+ function trigger() {
+ triggered = true;
+ }
+
+ element.bind( "blur", trigger );
+ element[ 0 ].blur();
+
+ // blur events are async in IE
+ setTimeout(function() {
+ // IE won't let the blur occur if the window is inactive
+ if ( element[ 0 ].ownerDocument.activeElement === element[ 0 ] ) {
+ element[ 0 ].ownerDocument.body.focus();
+ }
+
+ // Firefox won't trigger events if the window is inactive
+ // IE doesn't trigger events if we had to manually focus the body
+ if ( !triggered ) {
+ focusoutEvent = $.Event( "focusout" );
+ focusoutEvent.preventDefault();
+ element.trigger( focusoutEvent );
+ element.triggerHandler( "blur" );
+ }
+ element.unbind( "blur", trigger );
+ }, 1 );
+ }
+});
+
+$.extend( $.simulate, {
+ defaults: {
+ speed: "sync"
+ },
+ VK_TAB: 9,
+ VK_ENTER: 13,
+ VK_ESC: 27,
+ VK_PGUP: 33,
+ VK_PGDN: 34,
+ VK_END: 35,
+ VK_HOME: 36,
+ VK_LEFT: 37,
+ VK_UP: 38,
+ VK_RIGHT: 39,
+ VK_DOWN: 40
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js b/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js
new file mode 100644
index 0000000..c8dec48
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js
@@ -0,0 +1,39 @@
+(function( $ ) {
+
+var parts = document.location.search.slice( 1 ).split( "&" ),
+ length = parts.length,
+ i = 0,
+ current,
+ min;
+
+for ( ; i < length; i++ ) {
+ current = parts[ i ].split( "=" );
+ if ( current[ 0 ] === "min" ) {
+ min = current[ 1 ];
+ break;
+ }
+}
+
+function includeStyle( url ) {
+ document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
+}
+
+function includeScript( url ) {
+ document.write( "<script src='../../../" + url + "'></script>" );
+}
+
+window.loadResources = min ?
+ function() {
+ includeStyle( "build/dist/theme/jquery-ui.min.css" );
+ includeScript( "build/dist/jquery-ui.min.js" );
+ } :
+ function( resources ) {
+ $.each( resources.css || [], function( i, resource ) {
+ includeStyle( "themes/base/jquery." + resource + ".css" );
+ });
+ $.each( resources.js || [], function( i, resource ) {
+ includeScript( resource );
+ });
+ };
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html
new file mode 100644
index 0000000..606df0a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html
@@ -0,0 +1,161 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Static Test : Default</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+ <style>
+ div { margin: 0 0 1em; }
+ h2 { margin: 2em 0 1em; }
+ </style>
+</head>
+<body>
+
+ <h2>Using button elements</h2>
+
+ <div>
+ <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Button</span>
+ </button>
+
+ <button class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </button>
+
+ <button class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </button>
+
+ <button class="ui-button ui-button-text-icon-primary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </button>
+
+ <button class="ui-button ui-button-text-icon-secondary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </button>
+
+ <button class="ui-button ui-button-text-icons ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Both icons</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </button>
+
+ <button class="ui-button ui-button-icons-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">No text</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </button>
+ </div>
+
+ <h2>Using anchor elements</h2>
+
+ <div>
+ <a href="#" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Button</span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-text-icon-primary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-text-icon-secondary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-text-icons ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Both icons</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </a>
+
+ <a href="#" class="ui-button ui-button-icons-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">No text</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </a>
+ </div>
+
+
+
+ <h2>Using label elements (used when proxying to radio or check inputs)</h2>
+
+ <div>
+ <label class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Button</span>
+ </label>
+
+ <label class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </label>
+
+ <label class="ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all" title="Button">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </label>
+
+ <label class="ui-button ui-button-text-icon-primary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Primary icon</span>
+ </label>
+
+ <label class="ui-button ui-button-text-icon-secondary ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-text">Secondary icon</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </label>
+
+ <label class="ui-button ui-button-text-icons ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">Both icons</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </label>
+
+ <label class="ui-button ui-button-icons-only ui-widget ui-state-default ui-corner-all">
+ <span class="ui-button-icon-primary ui-icon ui-icon-gear"></span>
+ <span class="ui-button-text">No text</span>
+ <span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span>
+ </label>
+ </div>
+
+
+ <h2>Button Sets</h2>
+
+ <div class="ui-buttonset">
+ <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-left"><span class="ui-button-text">First</span></button>
+ <button class="ui-button ui-button-text-only ui-widget ui-state-default"><span class="ui-button-text">Middle</span></button>
+ <button class="ui-button ui-button-text-only ui-widget ui-state-default"><span class="ui-button-text">Middle</span></button>
+ <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-right"><span class="ui-button-text">Last</span></button>
+ </div>
+
+
+
+<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+<script>
+ $('<div/>').css({
+ position: "absolute",
+ right: 10,
+ top: 10
+ }).appendTo(document.body).themeswitcher();
+</script>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html
new file mode 100644
index 0000000..6b8253b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html
@@ -0,0 +1,1367 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery UI Datepicker Static Markup Test Page</title>
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+ <style type="text/css">
+ .ui-datepicker { float:left; margin: 0 2em 2em 0;}
+ .ui-datepicker-multi { clear:left; }
+ </style>
+ <!--[if gte IE 7]>
+ <style type="text/css">
+ .ui-datepicker { float:none; }
+ </style>
+ <![endif]-->
+</head>
+<body style="font-size: 62.5%;">
+
+<!-- Datepicker with read only month/year -->
+<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">December</span>
+ <span class="ui-datepicker-year">2008</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<!-- Datepicker with 1 combined select -->
+<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <select class="ui-datepicker-month-year">
+ <optgroup name="2007">
+ <option value="2007_0">January 2007</option>
+ <option value="2007_1">February 2007</option>
+ <option value="2007_2">March 2007</option>
+ <option value="2007_3">April 2007</option>
+ <option value="2007_4">May 2007</option>
+ <option value="2007_5">June 2007</option>
+ <option value="2007_6">July 2007</option>
+ <option value="2007_7">August 2007</option>
+ <option value="2007_8">September 2007</option>
+ <option value="2007_9">October 2007</option>
+ <option value="2007_10">November 2007</option>
+ <option value="2007_11">December 2007</option>
+ </optgroup>
+ <optgroup name="2008">
+ <option value="2008_0">January 2008</option>
+ <option value="2008_1">February 2008</option>
+ <option value="2008_2">March 2008</option>
+ <option value="2008_3">April 2008</option>
+ <option value="2008_4">May 2008</option>
+ <option value="2008_5">June 2008</option>
+ <option value="2008_6">July 2008</option>
+ <option value="2008_7">August 2008</option>
+ <option value="2008_8">September 2008</option>
+ <option value="2008_9">October 2008</option>
+ <option value="2008_10">November 2008</option>
+ <option selected="selected" value="2008_11">December 2008</option>
+ </optgroup>
+ <optgroup name="2009">
+ <option value="2009_0">January 2009</option>
+ <option value="2009_1">February 2009</option>
+ <option value="2009_2">March 2009</option>
+ <option value="2009_3">April 2009</option>
+ <option value="2009_4">May 2009</option>
+ <option value="2009_5">June 2009</option>
+ <option value="2009_6">July 2009</option>
+ <option value="2009_7">August 2009</option>
+ <option value="2009_8">September 2009</option>
+ <option value="2009_9">October 2009</option>
+ <option value="2009_10">November 2009</option>
+ <option value="2009_11">December 2009</option>
+ </optgroup>
+ <optgroup name="2010">
+ <option value="2010_0">January 2010</option>
+ <option value="2010_1">February 2010</option>
+ <option value="2010_2">March 2010</option>
+ <option value="2010_3">April 2010</option>
+ <option value="2010_4">May 2010</option>
+ <option value="2010_5">June 2010</option>
+ <option value="2010_6">July 2010</option>
+ <option value="2010_7">August 2010</option>
+ <option value="2010_8">September 2010</option>
+ <option value="2010_9">October 2010</option>
+ <option value="2010_10">November 2010</option>
+ <option value="2010_11">December 2010</option>
+ </optgroup>
+ </select>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<!-- Datepicker with 2 selects -->
+<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <select class="ui-datepicker-month">
+ <option value="0">Jan</option>
+ <option value="1">Feb</option>
+ <option value="2">Mar</option>
+ <option value="3">Apr</option>
+ <option value="4">May</option>
+ <option value="5">Jun</option>
+ <option value="6">Jul</option>
+ <option value="7">Aug</option>
+ <option value="8">Sep</option>
+ <option value="9">Oct</option>
+ <option value="10">Nov</option>
+ <option value="11" selected="selected">Dec</option>
+ </select>
+ <select class="ui-datepicker-year">
+ <option value="1998">1998</option>
+ <option value="1999">1999</option>
+ <option value="2000">2000</option>
+ <option value="2001">2001</option>
+ <option value="2002">2002</option>
+ <option value="2003">2003</option>
+ <option value="2004">2004</option>
+ <option value="2005">2005</option>
+ <option value="2006">2006</option>
+ <option value="2007">2007</option>
+ <option value="2008" selected="selected">2008</option>
+ <option value="2009">2009</option>
+ <option value="2010">2010</option>
+ <option value="2011">2011</option>
+ <option value="2012">2012</option>
+ <option value="2013">2013</option>
+ <option value="2014">2014</option>
+ <option value="2015">2015</option>
+ <option value="2016">2016</option>
+ <option value="2017">2017</option>
+ <option value="2018">2018</option>
+ </select>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<!-- Datepicker with button bar -->
+<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <select class="ui-datepicker-month">
+ <option value="0">Jan</option>
+ <option value="1">Feb</option>
+ <option value="2">Mar</option>
+ <option value="3">Apr</option>
+ <option value="4">May</option>
+ <option value="5">Jun</option>
+ <option value="6">Jul</option>
+ <option value="7">Aug</option>
+ <option value="8">Sep</option>
+ <option value="9">Oct</option>
+ <option value="10">Nov</option>
+ <option value="11" selected="selected">Dec</option>
+ </select>
+ <select class="ui-datepicker-year">
+ <option value="1998">1998</option>
+ <option value="1999">1999</option>
+ <option value="2000">2000</option>
+ <option value="2001">2001</option>
+ <option value="2002">2002</option>
+ <option value="2003">2003</option>
+ <option value="2004">2004</option>
+ <option value="2005">2005</option>
+ <option value="2006">2006</option>
+ <option value="2007">2007</option>
+ <option value="2008" selected="selected">2008</option>
+ <option value="2009">2009</option>
+ <option value="2010">2010</option>
+ <option value="2011">2011</option>
+ <option value="2012">2012</option>
+ <option value="2013">2013</option>
+ <option value="2014">2014</option>
+ <option value="2015">2015</option>
+ <option value="2016">2016</option>
+ <option value="2017">2017</option>
+ <option value="2018">2018</option>
+ </select>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="ui-datepicker-buttonpane ui-widget-content">
+ <button class="ui-state-default ui-priority-primary ui-corner-all">Done</button>
+ <button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all">Today</button>
+ </div>
+</div>
+
+<!-- Multiple Datepickers with read only month/year -->
+<div class="ui-datepicker ui-datepicker-multi ui-datepicker-multi-2 ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="width:34em;">
+ <div class="ui-datepicker-group ui-datepicker-group-first">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-left">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">December</span>
+ <span class="ui-datepicker-year">2008</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-last">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-right">
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">January</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+
+<!-- Multiple Datepickers with read only month/year -->
+<div class="ui-datepicker ui-datepicker-multi ui-datepicker-multi-3 ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="width:51em;">
+ <div class="ui-datepicker-group ui-datepicker-group-first">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-left">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">December</span>
+ <span class="ui-datepicker-year">2008</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-middle">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">January</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-last">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-right">
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">February</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-buttonpane ui-widget-content">
+ <button class="ui-state-default ui-priority-primary ui-corner-all">Done</button>
+ <button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all">Today</button>
+ </div>
+</div>
+
+<!-- Multiple Datepickers with read only month/year -->
+<div class="ui-datepicker ui-datepicker-multi ui-datepicker-multi-4 ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="width:60em;">
+ <div class="ui-datepicker-group ui-datepicker-group-first">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-left">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">December</span>
+ <span class="ui-datepicker-year">2008</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-middle">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">January</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">1</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class=""><a href="#" class="ui-state-default">6</a></td>
+ <td class=""><a href="#" class="ui-state-default">7</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">8</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class=""><a href="#" class="ui-state-default">13</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">14</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">15</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class=""><a href="#" class="ui-state-default">19</a></td>
+ <td class=""><a href="#" class="ui-state-default">20</a></td>
+ <td class=""><a href="#" class="ui-state-default">21</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">22</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class=""><a href="#" class="ui-state-default">27</a></td>
+ <td class=""><a href="#" class="ui-state-default">28</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">29</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-middle">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">February</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-last">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-right">
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">March</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+
+ <div class="ui-datepicker-row-break"></div>
+ <div class="ui-datepicker-group ui-datepicker-group-first">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">April</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-middle">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">May</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-middle">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">June</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="ui-datepicker-group ui-datepicker-group-last">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-right">
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">July</span>
+ <span class="ui-datepicker-year">2009</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">1</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class=""><a href="#" class="ui-state-default">6</a></td>
+ <td class=""><a href="#" class="ui-state-default">7</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">8</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class=""><a href="#" class="ui-state-default">13</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">14</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">15</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class=""><a href="#" class="ui-state-default">19</a></td>
+ <td class=""><a href="#" class="ui-state-default">20</a></td>
+ <td class=""><a href="#" class="ui-state-default">21</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">22</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class=""><a href="#" class="ui-state-default">27</a></td>
+ <td class=""><a href="#" class="ui-state-default">28</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">29</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html
new file mode 100644
index 0000000..9c81be1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Datepicker Static Test : Default</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
+ <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
+ <a title="Prev" class="ui-datepicker-prev ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
+ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
+ <div class="ui-datepicker-title">
+ <span class="ui-datepicker-month">December</span>
+ <span class="ui-datepicker-year">2008</span>
+ </div>
+ </div>
+ <table class="ui-datepicker-calendar">
+ <thead>
+ <tr>
+ <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
+ <th><span title="Monday">Mo</span></th>
+ <th><span title="Tuesday">Tu</span></th>
+ <th><span title="Wednesday">We</span></th>
+ <th><span title="Thursday">Th</span></th>
+ <th><span title="Friday">Fr</span></th>
+ <th class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class=""><a href="#" class="ui-state-default">1</a></td>
+ <td class="ui-datepicker-today"><a href="#" class="ui-state-default ui-state-highlight">2</a></td>
+ <td class=""><a href="#" class="ui-state-default">3</a></td>
+ <td class=""><a href="#" class="ui-state-default">4</a></td>
+ <td class=""><a href="#" class="ui-state-default">5</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">6</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">7</a></td>
+ <td class=""><a href="#" class="ui-state-default">8</a></td>
+ <td class=""><a href="#" class="ui-state-default">9</a></td>
+ <td class=""><a href="#" class="ui-state-default">10</a></td>
+ <td class=""><a href="#" class="ui-state-default">11</a></td>
+ <td class=""><a href="#" class="ui-state-default">12</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">13</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">14</a></td>
+ <td class=""><a href="#" class="ui-state-default">15</a></td>
+ <td class=""><a href="#" class="ui-state-default">16</a></td>
+ <td class=""><a href="#" class="ui-state-default">17</a></td>
+ <td class=""><a href="#" class="ui-state-default">18</a></td>
+ <td class="ui-datepicker-current-day"><a href="#" class="ui-state-active">19</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">20</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">21</a></td>
+ <td class=""><a href="#" class="ui-state-default">22</a></td>
+ <td class=""><a href="#" class="ui-state-default">23</a></td>
+ <td class=""><a href="#" class="ui-state-default">24</a></td>
+ <td class=""><a href="#" class="ui-state-default">25</a></td>
+ <td class=""><a href="#" class="ui-state-default">26</a></td>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">27</a></td>
+ </tr>
+ <tr>
+ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">28</a></td>
+ <td class=""><a href="#" class="ui-state-default">29</a></td>
+ <td class=""><a href="#" class="ui-state-default">30</a></td>
+ <td class=""><a href="#" class="ui-state-default">31</a></td>
+ <td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td><td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled">
+ </td></tr>
+ </tbody>
+ </table>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html
new file mode 100644
index 0000000..49edb0e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html
@@ -0,0 +1,246 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery UI CSS Framework Icons Test Page</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../jquery-1.7.1.js"></script>
+
+ <style type="text/css">
+ body {font-size: 62.5%; margin: 20px; font-family: Verdana, sans-serif; color: #444;}
+ h1 {font-size: 1.5em; margin: 1em 0;}
+ h2 {font-size: 1.3em; margin: 2em 0 .5em;}
+ h2 a {font-size: .8em;}
+ p {font-size: 1.2em; }
+ ul {margin: 0; padding: 0;}
+ td div {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
+ span.ui-icon { float: left; margin: 0 4px;}
+ </style>
+
+ <script type="text/javascript">
+ $(function(){
+ $('.ui-state-default').hover(
+ function(){ $(this).addClass('ui-state-hover'); },
+ function(){ $(this).removeClass('ui-state-hover'); }
+ );
+
+ $('.ui-state-default').click(function(){
+ $(this).toggleClass('ui-state-active');
+ });
+
+ });
+ </script>
+</head>
+<body>
+
+<p class="icons"></p>
+
+<table class="ui-widget icon-collection" cellpaddding="0" cellspacing="0">
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-w"><span class="ui-icon ui-icon-carat-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-nw"><span class="ui-icon ui-icon-carat-1-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-n-s"><span class="ui-icon ui-icon-carat-2-n-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></div></td>
+ </tr>
+ <tr>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></div></td>
+ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></div></td></ul>
+ </tr>
+</table>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html
new file mode 100644
index 0000000..aec1f78
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Default</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html
new file mode 100644
index 0000000..6ddf1de
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Default vertical</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-vertical ui-widget ui-widget-content ui-corner-all"><a style="bottom: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html
new file mode 100644
index 0000000..e28d9d7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider horizontal</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><a style="left: 50%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html
new file mode 100644
index 0000000..227ce44
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider horizontal range</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><div style="left: 25%; width: 50%;" class="ui-slider-range ui-widget-header"></div><a style="left: 25%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a><a style="left: 75%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html
new file mode 100644
index 0000000..11b2a96
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider horizontal range max</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><div style="width:25%;" class="ui-slider-range ui-slider-range-max ui-widget-header"></div><a style="left: 75%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html
new file mode 100644
index 0000000..9ed15f5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider horizontal range min</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"><div style="width: 25%;" class="ui-slider-range ui-slider-range-min ui-widget-header"></div><a style="left: 25%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html
new file mode 100644
index 0000000..63ef3d1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider vertical</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-vertical ui-widget ui-widget-content ui-corner-all"><a style="bottom: 50%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html
new file mode 100644
index 0000000..4f1ffb0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider vertical range</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-vertical ui-widget ui-widget-content ui-corner-all"><div style="bottom: 25%; height: 50%;" class="ui-slider-range ui-widget-header"></div><a style="bottom: 25%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a><a style="bottom: 75%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html
new file mode 100644
index 0000000..a5c9857
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider vertical range max</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-vertical ui-widget ui-widget-content ui-corner-all"><div style="height: 25%;" class="ui-slider-range ui-slider-range-max ui-widget-header"></div><a style="bottom: 75%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html
new file mode 100644
index 0000000..b43d451
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Slider Static Test : Slider vertical range min</title>
+ <link rel="stylesheet" href="../static.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../static.js"></script>
+</head>
+<body>
+
+<div class="ui-slider ui-slider-vertical ui-widget ui-widget-content ui-corner-all"><div style="height:25%;" class="ui-slider-range ui-slider-range-min ui-widget-header"></div><a style="bottom: 25%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css
new file mode 100644
index 0000000..60f25b5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css
@@ -0,0 +1 @@
+body { font-size: 62.5%; }
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js
new file mode 100644
index 0000000..1c29079
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js
@@ -0,0 +1,9 @@
+/* static_helpers.js
+ */
+$(function(){
+ //add hover states on the static widgets
+ $('.ui-state-default:not(.ui-state-disabled, .ui-slider-range, .ui-progressbar-value), a.ui-datepicker-next, a.ui-datepicker-prev, .ui-dialog-titlebar-close').hover(
+ function(){ $(this).addClass('ui-state-hover'); },
+ function(){ $(this).removeClass('ui-state-hover'); }
+ );
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html
new file mode 100644
index 0000000..ed9b1aa
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html
@@ -0,0 +1,144 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Accordion Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script>
+ $.uiBackCompat = false;
+ </script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.accordion" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.accordion.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="accordion_test_helpers.js"></script>
+ <script src="accordion_defaults.js"></script>
+ <script src="accordion_core.js"></script>
+ <script src="accordion_events.js"></script>
+ <script src="accordion_methods.js"></script>
+ <script src="accordion_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+ <style>
+ #list, #list1 *, #navigation, #navigation * {
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
+ line-height: 15px;
+ }
+ </style>
+</head>
+<body>
+<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="list1" class="foo">
+ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
+ <div class="foo">
+ <p>
+ You've seen it coming!
+ <br>
+ Buy now and get nothing for free!
+ <br>
+ Well, at least no free beer. Perhaps a bear, if you can afford it.
+ </p>
+ </div>
+ <h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
+ <div class="foo">
+ <p>
+ your bear, you have to admit it!
+ <br>
+ No, we aren't selling bears.
+ </p>
+ <p>
+ We could talk about renting one.
+ </p>
+ </div>
+ <h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
+ <div class="foo">
+ <p>
+ get two for three beer.
+ </p>
+ <p>
+ And now, for something completely different.
+ </p>
+ </div>
+</div>
+
+<div id="navigationWrapper">
+ <ul id="navigation">
+ <li>
+ <h2><a href="?p=1.1.1">Guitar</a></h2>
+ <ul>
+ <li><a href="?p=1.1.1.1">Electric</a></li>
+ <li><a href="?p=1.1.1.2">Acoustic</a></li>
+ <li><a href="?p=1.1.1.3">Amps</a></li>
+ <li><a href="?p=1.1.1.4">Effects</a></li>
+ <li><a href="?p=1.1.1.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <h2><a href="?p=1.1.2"><span>Bass</span></a></h2>
+ <ul>
+ <li><a href="?p=1.1.2.1">Electric</a></li>
+ <li><a href="?p=1.1.2.2">Acoustic</a></li>
+ <li><a href="?p=1.1.2.3">Amps</a></li>
+ <li><a href="?p=1.1.2.4">Effects</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <h2><a href="?p=1.1.3">Drums</a></h2>
+ <ul>
+ <li><a href="?p=1.1.3.2">Acoustic</a></li>
+ <li><a href="?p=1.1.3.3">Electronic</a></li>
+ <li><a href="?p=1.1.3.6">Accessories</a></li>
+ </ul>
+ </li>
+ </ul>
+</div>
+
+<dl id="accordion-dl">
+ <dt>
+ <a href="#">Accordion Header 1</a>
+ </dt>
+ <dd>
+ Accordion Content 1
+ </dd>
+ <dt>
+ <a href="#">Accordion Header 2</a>
+ </dt>
+ <dd>
+ Accordion Content 2
+ </dd>
+ <dt>
+ <a href="#">Accordion Header 3</a>
+ </dt>
+ <dd>
+ Accordion Content 3
+ </dd>
+</dl>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js
new file mode 100644
index 0000000..3442cad
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js
@@ -0,0 +1,55 @@
+(function( $ ) {
+
+module( "accordion: core", accordion_setupTeardown() );
+
+$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) {
+ test( "markup structure: " + type, function() {
+ expect( 4 );
+ var element = $( selector ).accordion();
+ ok( element.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
+ equal( element.find( ".ui-accordion-header" ).length, 3,
+ ".ui-accordion-header elements exist, correct number" );
+ equal( element.find( ".ui-accordion-content" ).length, 3,
+ ".ui-accordion-content elements exist, correct number" );
+ deepEqual( element.find( ".ui-accordion-header" ).next().get(),
+ element.find( ".ui-accordion-content" ).get(),
+ "content panels come immediately after headers" );
+ });
+});
+
+test( "handle click on header-descendant", function() {
+ expect( 1 );
+ var element = $( "#navigation" ).accordion();
+ $( "#navigation h2:eq(1) a" ).click();
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "ui-accordion-heading class added to headers anchor", function() {
+ expect( 1 );
+ var element = $( "#list1" ).accordion();
+ var anchors = element.find( ".ui-accordion-heading" );
+ equal( anchors.length, 3 );
+});
+
+test( "accessibility", function () {
+ expect( 13 );
+ var element = $( "#list1" ).accordion().accordion( "option", "active", 1 );
+ var headers = element.find( ".ui-accordion-header" );
+
+ equal( headers.eq( 1 ).attr( "tabindex" ), 0, "active header should have tabindex=0" );
+ equal( headers.eq( 0 ).attr( "tabindex" ), -1, "inactive header should have tabindex=-1" );
+ equal( element.attr( "role" ), "tablist", "main role" );
+ equal( headers.attr( "role" ), "tab", "tab roles" );
+ equal( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" );
+ equal( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" );
+ equal( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" );
+ equal( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
+ equal( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
+ element.accordion( "option", "active", 0 );
+ equal( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" );
+ equal( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" );
+ equal( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
+ equal( headers.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js
new file mode 100644
index 0000000..9aa58e6
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js
@@ -0,0 +1,20 @@
+commonWidgetTests( "accordion", {
+ defaults: {
+ active: 0,
+ animated: "slide",
+ collapsible: false,
+ disabled: false,
+ event: "click",
+ header: "> li > :first-child,> :not(li):even",
+ heightStyle: "auto",
+ icons: {
+ "activeHeader": "ui-icon-triangle-1-s",
+ "header": "ui-icon-triangle-1-e"
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js
new file mode 100644
index 0000000..3f45a1f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js
@@ -0,0 +1,28 @@
+commonWidgetTests( "accordion", {
+ defaults: {
+ active: 0,
+ animated: "slide",
+ autoHeight: true,
+ clearStyle: false,
+ collapsible: false,
+ disabled: false,
+ event: "click",
+ fillSpace: false,
+ header: "> li > :first-child,> :not(li):even",
+ heightStyle: null,
+ icons: {
+ "activeHeader": null,
+ "header": "ui-icon-triangle-1-e",
+ "headerSelected": "ui-icon-triangle-1-s"
+ },
+ navigation: false,
+ navigationFilter: function() {},
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ change: null,
+ changestart: null,
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html
new file mode 100644
index 0000000..f730d80
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html
@@ -0,0 +1,142 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Accordion Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.accordion" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.accordion.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="accordion_test_helpers.js"></script>
+ <script src="accordion_defaults_deprecated.js"></script>
+ <script src="accordion_core.js"></script>
+ <script src="accordion_events.js"></script>
+ <script src="accordion_methods.js"></script>
+ <script src="accordion_options.js"></script>
+ <script src="accordion_deprecated.js"></script>
+
+ <script src="../swarminject.js"></script>
+ <style>
+ #list, #list1 *, #navigation, #navigation * {
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
+ line-height: 15px;
+ }
+ </style>
+</head>
+<body>
+<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="list1" class="foo">
+ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
+ <div class="foo">
+ <p>
+ You've seen it coming!
+ <br>
+ Buy now and get nothing for free!
+ <br>
+ Well, at least no free beer. Perhaps a bear, if you can afford it.
+ </p>
+ </div>
+ <h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
+ <div class="foo">
+ <p>
+ your bear, you have to admit it!
+ <br>
+ No, we aren't selling bears.
+ </p>
+ <p>
+ We could talk about renting one.
+ </p>
+ </div>
+ <h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
+ <div class="foo">
+ <p>
+ get two for three beer.
+ </p>
+ <p>
+ And now, for something completely different.
+ </p>
+ </div>
+</div>
+
+<div id="navigationWrapper">
+ <ul id="navigation">
+ <li>
+ <h2><a href="?p=1.1.1">Guitar</a></h2>
+ <ul>
+ <li><a href="?p=1.1.1.1">Electric</a></li>
+ <li><a href="?p=1.1.1.2">Acoustic</a></li>
+ <li><a href="?p=1.1.1.3">Amps</a></li>
+ <li><a href="?p=1.1.1.4">Effects</a></li>
+ <li><a href="?p=1.1.1.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <h2><a href="?p=1.1.2"><span>Bass</span></a></h2>
+ <ul>
+ <li><a href="?p=1.1.2.1">Electric</a></li>
+ <li><a href="?p=1.1.2.2">Acoustic</a></li>
+ <li><a href="?p=1.1.2.3">Amps</a></li>
+ <li><a href="?p=1.1.2.4">Effects</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <h2><a href="?p=1.1.3">Drums</a></h2>
+ <ul>
+ <li><a href="?p=1.1.3.2">Acoustic</a></li>
+ <li><a href="?p=1.1.3.3">Electronic</a></li>
+ <li><a href="?p=1.1.3.6">Accessories</a></li>
+ </ul>
+ </li>
+ </ul>
+</div>
+
+<dl id="accordion-dl">
+ <dt>
+ <a href="#">Accordion Header 1</a>
+ </dt>
+ <dd>
+ Accordion Content 1
+ </dd>
+ <dt>
+ <a href="#">Accordion Header 2</a>
+ </dt>
+ <dd>
+ Accordion Content 2
+ </dd>
+ <dt>
+ <a href="#">Accordion Header 3</a>
+ </dt>
+ <dd>
+ Accordion Content 3
+ </dd>
+</dl>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js
new file mode 100644
index 0000000..eec034e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js
@@ -0,0 +1,338 @@
+(function( $ ) {
+
+module( "accordion (deprecated): expanded active option, activate method", accordion_setupTeardown() );
+
+test( "activate, numeric", function() {
+ expect( 5 );
+ var element = $( "#list1" ).accordion({ active: 1 });
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", 0 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", 1 );
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+});
+
+test( "activate, numeric, collapsible:true", function() {
+ expect( 3 );
+ var element = $( "#list1" ).accordion({ collapsible: true });
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", 0 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", -1 );
+ accordion_state( element, 0, 0, 0 );
+});
+
+test( "activate, boolean, collapsible: true", function() {
+ expect( 2 );
+ var element = $( "#list1" ).accordion({ collapsible: true });
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", false );
+ accordion_state( element, 0, 0, 0 );
+});
+
+test( "activate, boolean, collapsible: false", function() {
+ expect( 2 );
+ var element = $( "#list1" ).accordion();
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", false );
+ accordion_state( element, 0, 0, 1 );
+});
+
+test( "activate, string expression", function() {
+ expect( 4 );
+ var element = $( "#list1" ).accordion({ active: "h3:last" });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", ":first" );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", ":eq(1)" );
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", ":last" );
+ accordion_state( element, 0, 0, 1 );
+});
+
+test( "activate, jQuery or DOM element", function() {
+ expect( 3 );
+ var element = $( "#list1" ).accordion({ active: $( "#list1 h3:last" ) });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", $( "#list1 h3:first" ) );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", $( "#list1 h3" )[ 1 ] );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ active: Selector }", function() {
+ expect( 2 );
+ var element = $("#list1").accordion({
+ active: "h3:last"
+ });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", "h3:eq(1)" );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ active: Element }", function() {
+ expect( 2 );
+ var element = $( "#list1" ).accordion({
+ active: $( "#list1 h3:last" )[ 0 ]
+ });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", $( "#list1 h3:eq(1)" )[ 0 ] );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ active: jQuery Object }", function() {
+ expect( 2 );
+ var element = $( "#list1" ).accordion({
+ active: $( "#list1 h3:last" )
+ });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", $( "#list1 h3:eq(1)" ) );
+ accordion_state( element, 0, 1, 0 );
+});
+
+
+
+
+
+module( "accordion (deprecated) - height options", accordion_setupTeardown() );
+
+test( "{ autoHeight: true }, default", function() {
+ expect( 3 );
+ accordion_equalHeights( $( "#navigation" ).accordion({ autoHeight: true }), 95, 130 );
+});
+
+test( "{ autoHeight: false }", function() {
+ expect( 3 );
+ var element = $( "#navigation" ).accordion({ autoHeight: false });
+ var sizes = [];
+ element.find( ".ui-accordion-content" ).each(function() {
+ sizes.push( $(this).height() );
+ });
+ ok( sizes[0] >= 70 && sizes[0] <= 105, "was " + sizes[0] );
+ ok( sizes[1] >= 98 && sizes[1] <= 126, "was " + sizes[1] );
+ ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] );
+});
+
+test( "{ fillSpace: true }", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ accordion_equalHeights( element, 446, 458 );
+});
+
+test( "{ fillSapce: true } with sibling", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30
+ })
+ .prependTo( "#navigationWrapper" );
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ accordion_equalHeights( element , 346, 358);
+});
+
+test( "{ fillSpace: true } with multiple siblings", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30
+ })
+ .prependTo( "#navigationWrapper" );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30,
+ position: "absolute"
+ })
+ .prependTo( "#navigationWrapper" );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 25,
+ marginTop: 10,
+ marginBottom: 15
+ })
+ .prependTo( "#navigationWrapper" );
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ accordion_equalHeights( element, 296, 308 );
+});
+
+
+
+
+
+module( "accordion (deprecated) - icons", accordion_setupTeardown() );
+
+test( "icons, headerSelected", function() {
+ expect( 3 );
+ var element = $( "#list1" ).accordion({
+ icons: { headerSelected: "a1", header: "h1" }
+ });
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ element.accordion( "option", "icons", { headerSelected: "a2", header: "h2" } );
+ ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
+});
+
+
+
+
+
+module( "accordion (deprecated) - resize", accordion_setupTeardown() );
+
+test( "resize", function() {
+ expect( 6 );
+ var element = $( "#navigation" )
+ .parent()
+ .height( 300 )
+ .end()
+ .accordion({
+ heightStyle: "fill"
+ });
+ accordion_equalHeights( element, 246, 258 );
+
+ element.parent().height( 500 );
+ element.accordion( "resize" );
+ accordion_equalHeights( element, 446, 458 );
+});
+
+
+
+
+
+module( "accordion (deprecated) - navigation", accordion_setupTeardown() );
+
+test( "{ navigation: true, navigationFilter: header }", function() {
+ expect( 2 );
+ var element = $( "#navigation" ).accordion({
+ navigation: true,
+ navigationFilter: function() {
+ return /\?p=1\.1\.3$/.test( this.href );
+ }
+ });
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+});
+
+test( "{ navigation: true, navigationFilter: content }", function() {
+ expect( 2 );
+ var element = $( "#navigation" ).accordion({
+ navigation: true,
+ navigationFilter: function() {
+ return /\?p=1\.1\.3\.2$/.test( this.href );
+ }
+ });
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+});
+
+
+
+
+
+module( "accordion (deprecated) - changestart/change events", accordion_setupTeardown() );
+
+test( "changestart", function() {
+ expect( 26 );
+ var element = $( "#list1" ).accordion({
+ active: false,
+ collapsible: true
+ });
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
+
+ element.one( "accordionchangestart", function( event, ui ) {
+ equal( ui.oldHeader.size(), 0 );
+ equal( ui.oldContent.size(), 0 );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 0 ] );
+ accordion_state( element, 0, 0, 0 );
+ });
+ element.accordion( "option", "active", 0 );
+ accordion_state( element, 1, 0, 0 );
+
+ element.one( "accordionchangestart", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 1 ] );
+ accordion_state( element, 1, 0, 0 );
+ });
+ headers.eq( 1 ).click();
+ accordion_state( element, 0, 1, 0 );
+
+ element.one( "accordionchangestart", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
+ equal( ui.newHeader.size(), 0 );
+ equal( ui.newContent.size(), 0 );
+ accordion_state( element, 0, 1, 0 );
+ });
+ element.accordion( "option", "active", false );
+ accordion_state( element, 0, 0, 0 );
+});
+
+test( "change", function() {
+ expect( 20 );
+ var element = $( "#list1" ).accordion({
+ active: false,
+ collapsible: true
+ });
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
+
+ element.one( "accordionchange", function( event, ui ) {
+ equal( ui.oldHeader.size(), 0 );
+ equal( ui.oldContent.size(), 0 );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 0 ] );
+ });
+ element.accordion( "option", "active", 0 );
+
+ element.one( "accordionchange", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 1 ] );
+ });
+ headers.eq( 1 ).click();
+
+ element.one( "accordionchange", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
+ equal( ui.newHeader.size(), 0 );
+ equal( ui.newContent.size(), 0 );
+ });
+ element.accordion( "option", "active", false );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js
new file mode 100644
index 0000000..12acf2a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js
@@ -0,0 +1,122 @@
+(function( $ ) {
+
+module( "accordion: events", accordion_setupTeardown() );
+
+test( "beforeActivate", function() {
+ expect( 38 );
+ var element = $( "#list1" ).accordion({
+ active: false,
+ collapsible: true
+ });
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
+
+ element.one( "accordionbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ) );
+ equal( ui.oldHeader.size(), 0 );
+ equal( ui.oldContent.size(), 0 );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 0 ] );
+ accordion_state( element, 0, 0, 0 );
+ });
+ element.accordion( "option", "active", 0 );
+ accordion_state( element, 1, 0, 0 );
+
+ element.one( "accordionbeforeactivate", function( event, ui ) {
+ equal( event.originalEvent.type, "click" );
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 1 ] );
+ accordion_state( element, 1, 0, 0 );
+ });
+ headers.eq( 1 ).click();
+ accordion_state( element, 0, 1, 0 );
+
+ element.one( "accordionbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ) );
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
+ equal( ui.newHeader.size(), 0 );
+ equal( ui.newContent.size(), 0 );
+ accordion_state( element, 0, 1, 0 );
+ });
+ element.accordion( "option", "active", false );
+ accordion_state( element, 0, 0, 0 );
+
+ element.one( "accordionbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ) );
+ equal( ui.oldHeader.size(), 0 );
+ equal( ui.oldContent.size(), 0 );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 2 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 2 ] );
+ event.preventDefault();
+ accordion_state( element, 0, 0, 0 );
+ });
+ element.accordion( "option", "active", 2 );
+ accordion_state( element, 0, 0, 0 );
+});
+
+test( "activate", function() {
+ expect( 21 );
+ var element = $( "#list1" ).accordion({
+ active: false,
+ collapsible: true
+ });
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
+
+ element.one( "accordionactivate", function( event, ui ) {
+ equal( ui.oldHeader.size(), 0 );
+ equal( ui.oldContent.size(), 0 );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 0 ] );
+ });
+ element.accordion( "option", "active", 0 );
+
+ element.one( "accordionactivate", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
+ equal( ui.newHeader.size(), 1 );
+ strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
+ equal( ui.newContent.size(), 1 );
+ strictEqual( ui.newContent[ 0 ], content[ 1 ] );
+ });
+ headers.eq( 1 ).click();
+
+ element.one( "accordionactivate", function( event, ui ) {
+ equal( ui.oldHeader.size(), 1 );
+ strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
+ equal( ui.oldContent.size(), 1 );
+ strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
+ equal( ui.newHeader.size(), 0 );
+ equal( ui.newContent.size(), 0 );
+ });
+ element.accordion( "option", "active", false );
+
+ // prevent activation
+ element.one( "accordionbeforeactivate", function( event ) {
+ ok( true );
+ event.preventDefault();
+ });
+ element.one( "accordionactivate", function() {
+ ok( false );
+ });
+ element.accordion( "option", "active", 1 );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js
new file mode 100644
index 0000000..9f61647
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js
@@ -0,0 +1,40 @@
+(function( $ ) {
+
+module( "accordion: methods", accordion_setupTeardown() );
+
+test( "destroy", function() {
+ expect( 1 );
+ domEqual( "#list1", function() {
+ $( "#list1" ).accordion().accordion( "destroy" );
+ });
+});
+
+test( "enable/disable", function() {
+ expect( 3 );
+ var element = $( "#list1" ).accordion();
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "disable" );
+ element.accordion( "option", "active", 1 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "enable" );
+ element.accordion( "option", "active", 1 );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "refresh", function() {
+ expect( 6 );
+ var element = $( "#navigation" )
+ .parent()
+ .height( 300 )
+ .end()
+ .accordion({
+ heightStyle: "fill"
+ });
+ accordion_equalHeights( element, 246, 258 );
+
+ element.parent().height( 500 );
+ element.accordion( "refresh" );
+ accordion_equalHeights( element, 446, 458 );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js
new file mode 100644
index 0000000..a60bb27
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js
@@ -0,0 +1,283 @@
+(function( $ ) {
+
+module( "accordion: options", accordion_setupTeardown() );
+
+test( "{ active: default }", function() {
+ expect( 2 );
+ var element = $( "#list1" ).accordion();
+ equal( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
+});
+
+test( "{ active: false }", function() {
+ expect( 7 );
+ var element = $( "#list1" ).accordion({
+ active: false,
+ collapsible: true
+ });
+ accordion_state( element, 0, 0, 0 );
+ equal( element.find( ".ui-accordion-header.ui-state-active" ).size(), 0, "no headers selected" );
+ equal( element.accordion( "option", "active" ), false );
+
+ element.accordion( "option", "collapsible", false );
+ accordion_state( element, 1, 0, 0 );
+ equal( element.accordion( "option", "active" ), 0 );
+
+ element.accordion( "destroy" );
+ element.accordion({
+ active: false
+ });
+ accordion_state( element, 1, 0, 0 );
+ strictEqual( element.accordion( "option", "active" ), 0 );
+});
+
+test( "{ active: Number }", function() {
+ expect( 8 );
+ var element = $( "#list1" ).accordion({
+ active: 2
+ });
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+
+ element.accordion( "option", "active", 0 );
+ equal( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
+
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.accordion( "option", "active", 10 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+});
+
+if ( $.uiBackCompat === false ) {
+ test( "{ active: -Number }", function() {
+ expect( 8 );
+ var element = $( "#list1" ).accordion({
+ active: -1
+ });
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+
+ element.accordion( "option", "active", -2 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.accordion( "option", "active", -10 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.accordion( "option", "active", -3 );
+ equal( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
+ });
+}
+
+// TODO: add animation tests
+
+test( "{ collapsible: false }", function() {
+ expect( 4 );
+ var element = $( "#list1" ).accordion({
+ active: 1
+ });
+ element.accordion( "option", "active", false );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ collapsible: true }", function() {
+ expect( 6 );
+ var element = $( "#list1" ).accordion({
+ active: 1,
+ collapsible: true
+ });
+
+ element.accordion( "option", "active", false );
+ equal( element.accordion( "option", "active" ), false );
+ accordion_state( element, 0, 0, 0 );
+
+ element.accordion( "option", "active", 1 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equal( element.accordion( "option", "active" ), false );
+ accordion_state( element, 0, 0, 0 );
+});
+
+test( "{ event: null }", function() {
+ expect( 5 );
+ var element = $( "#list1" ).accordion({
+ event: null
+ });
+ accordion_state( element, 1, 0, 0 );
+
+ element.accordion( "option", "active", 1 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ element.find( ".ui-accordion-header" ).eq( 2 ).click();
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ event: custom }", function() {
+ expect( 11 );
+ var element = $( "#list1" ).accordion({
+ event: "custom1 custom2"
+ });
+ accordion_state( element, 1, 0, 0 );
+
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+
+ element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "custom2" );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+
+ element.accordion( "option", "event", "custom3" );
+
+ // ensure old event handlers are unbound
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
+
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom3" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
+});
+
+test( "{ header: default }", function() {
+ expect( 2 );
+ // default: > li > :first-child,> :not(li):even
+ // > :not(li):even
+ accordion_state( $( "#list1" ).accordion(), 1, 0, 0);
+ // > li > :first-child
+ accordion_state( $( "#navigation" ).accordion(), 1, 0, 0);
+});
+
+test( "{ header: custom }", function() {
+ expect( 6 );
+ var element = $( "#navigationWrapper" ).accordion({
+ header: "h2"
+ });
+ element.find( "h2" ).each(function() {
+ ok( $( this ).hasClass( "ui-accordion-header" ) );
+ });
+ equal( element.find( ".ui-accordion-header" ).length, 3 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "option", "active", 2 );
+ accordion_state( element, 0, 0, 1 );
+});
+
+test( "{ heightStyle: 'auto' }", function() {
+ expect( 3 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "auto" });
+ accordion_equalHeights( element, 95, 130 );
+});
+
+test( "{ heightStyle: 'content' }", function() {
+ expect( 3 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "content" });
+ var sizes = element.find( ".ui-accordion-content" ).map(function() {
+ return $( this ).height();
+ }).get();
+ ok( sizes[ 0 ] >= 70 && sizes[ 0 ] <= 105, "was " + sizes[ 0 ] );
+ ok( sizes[ 1 ] >= 98 && sizes[ 1 ] <= 126, "was " + sizes[ 1 ] );
+ ok( sizes[ 2 ] >= 42 && sizes[ 2 ] <= 54, "was " + sizes[ 2 ] );
+});
+
+test( "{ heightStyle: 'fill' }", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ accordion_equalHeights( element, 446, 458 );
+});
+
+test( "{ heightStyle: 'fill' } with sibling", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30
+ })
+ .prependTo( "#navigationWrapper" );
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ accordion_equalHeights( element , 346, 358);
+});
+
+test( "{ heightStyle: 'fill' } with multiple siblings", function() {
+ expect( 3 );
+ $( "#navigationWrapper" ).height( 500 );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30
+ })
+ .prependTo( "#navigationWrapper" );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 50,
+ marginTop: 20,
+ marginBottom: 30,
+ position: "absolute"
+ })
+ .prependTo( "#navigationWrapper" );
+ $( "<p>Lorem Ipsum</p>" )
+ .css({
+ height: 25,
+ marginTop: 10,
+ marginBottom: 15
+ })
+ .prependTo( "#navigationWrapper" );
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ accordion_equalHeights( element, 296, 308 );
+});
+
+test( "{ icons: false }", function() {
+ expect( 8 );
+ var element = $( "#list1" );
+ function icons( on ) {
+ deepEqual( element.find( "span.ui-icon").length, on ? 3 : 0 );
+ deepEqual( element.hasClass( "ui-accordion-icons" ), on );
+ }
+ element.accordion();
+ icons( true );
+ element.accordion( "destroy" ).accordion({
+ icons: false
+ });
+ icons( false );
+ element.accordion( "option", "icons", { header: "foo", activeHeader: "bar" } );
+ icons( true );
+ element.accordion( "option", "icons", false );
+ icons( false );
+});
+
+test( "{ icons: hash }", function() {
+ expect( 3 );
+ var element = $( "#list1" ).accordion({
+ icons: { activeHeader: "a1", header: "h1" }
+ });
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ element.accordion( "option", "icons", { activeHeader: "a2", header: "h2" } );
+ ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js
new file mode 100644
index 0000000..66d60a4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js
@@ -0,0 +1,30 @@
+function accordion_state( accordion ) {
+ var expected = $.makeArray( arguments ).slice( 1 );
+ var actual = accordion.find( ".ui-accordion-content" ).map(function() {
+ return $( this ).css( "display" ) === "none" ? 0 : 1;
+ }).get();
+ deepEqual( actual, expected );
+}
+
+function accordion_equalHeights( accordion, min, max ) {
+ var sizes = [];
+ accordion.find( ".ui-accordion-content" ).each(function() {
+ sizes.push( $( this ).outerHeight() );
+ });
+ ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
+ "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
+ deepEqual( sizes[ 0 ], sizes[ 1 ] );
+ deepEqual( sizes[ 0 ], sizes[ 2 ] );
+}
+
+function accordion_setupTeardown() {
+ var animated = $.ui.accordion.prototype.options.animated;
+ return {
+ setup: function() {
+ $.ui.accordion.prototype.options.animated = false;
+ },
+ teardown: function() {
+ $.ui.accordion.prototype.options.animated = animated;
+ }
+ };
+}
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html
new file mode 100644
index 0000000..0d600e1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Accordion Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "accordion" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html
new file mode 100644
index 0000000..d5152bb
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html
@@ -0,0 +1,72 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Test Suite</title>
+
+ <script src="../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../external/qunit.css">
+ <link rel="stylesheet" href="subsuiteRunner.css">
+ <script src="../../external/qunit.js"></script>
+ <script src="subsuiteRunner.js"></script>
+
+ <script>
+ (function() {
+
+ var params = [],
+ suites = [
+ "accordion/accordion.html",
+ "accordion/accordion_deprecated.html",
+ "autocomplete/autocomplete.html",
+ "button/button.html",
+ "core/core.html",
+ "datepicker/datepicker.html",
+ "dialog/dialog.html",
+ //"draggable/draggable.html",
+ //"droppable/droppable.html",
+ "effects/effects.html",
+ "menu/menu.html",
+ "position/position.html",
+ "position/position_deprecated.html",
+ "progressbar/progressbar.html",
+ //"resizable/resizable.html",
+ //"selectable/selectable.html",
+ "slider/slider.html",
+ //"sortable/sortable.html",
+ "spinner/spinner.html",
+ "tabs/tabs.html",
+ "tabs/tabs_deprecated.html",
+ "tooltip/tooltip.html",
+ "widget/widget.html"
+ ];
+
+ $.each( QUnit.urlParams, function( key, value ) {
+ if ( key === "filter" ) {
+ return;
+ }
+ params.push( encodeURIComponent( key ) + "=" + encodeURIComponent( value ) );
+ });
+ if ( params.length ) {
+ params = "?" + params.join( "&" );
+ suites = $.map( suites, function( suite ) {
+ return suite + params;
+ });
+ }
+ QUnit.testSuites( suites );
+
+ }());
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html
new file mode 100644
index 0000000..c644e27
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Autocomplete Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "autocomplete" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Autocomplete Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html
new file mode 100644
index 0000000..70d2ecf
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Autocomplete Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.menu", "ui.autocomplete" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.position.js",
+ "ui/jquery.ui.menu.js",
+ "ui/jquery.ui.autocomplete.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="autocomplete_defaults.js"></script>
+ <script src="autocomplete_core.js"></script>
+ <script src="autocomplete_events.js"></script>
+ <script src="autocomplete_methods.js"></script>
+ <script src="autocomplete_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Autocomplete Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="ac-wrap1" class="ac-wrap"></div>
+<div id="ac-wrap2" class="ac-wrap"><input id="autocomplete" class="foo"></div>
+<div id="autocomplete-contenteditable" contenteditable="" tabindex=0></div>
+<textarea id="autocomplete-textarea"></textarea>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js
new file mode 100644
index 0000000..3f92aa0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js
@@ -0,0 +1,83 @@
+(function( $ ) {
+
+module( "autocomplete: core" );
+
+asyncTest( "close-on-blur is properly delayed", function() {
+ expect( 3 );
+ var element = $( "#autocomplete" )
+ .autocomplete({
+ source: [ "java", "javascript" ]
+ })
+ .val( "ja" )
+ .autocomplete( "search" ),
+ menu = element.autocomplete( "widget" );
+
+ ok( menu.is( ":visible" ) );
+ element.blur();
+ ok( menu.is( ":visible" ) );
+ setTimeout(function() {
+ ok( menu.is( ":hidden") );
+ start();
+ }, 200 );
+});
+
+asyncTest( "close-on-blur is cancelled when starting a search", function() {
+ expect( 3 );
+ var element = $( "#autocomplete" )
+ .autocomplete({
+ source: [ "java", "javascript" ]
+ })
+ .val( "ja" )
+ .autocomplete( "search" ),
+ menu = element.autocomplete( "widget" );
+
+ ok( menu.is( ":visible" ) );
+ element.blur();
+ ok( menu.is( ":visible" ) );
+ element.autocomplete( "search" );
+ setTimeout(function() {
+ ok( menu.is( ":visible" ) );
+ start();
+ }, 200 );
+});
+
+test( "prevent form submit on enter when menu is active", function() {
+ expect( 2 );
+ var event,
+ element = $( "#autocomplete" )
+ .autocomplete({
+ source: [ "java", "javascript" ]
+ })
+ .val( "ja" )
+ .autocomplete( "search" ),
+ menu = element.autocomplete( "widget" );
+
+ event = $.Event( "keydown" );
+ event.keyCode = $.ui.keyCode.DOWN;
+ element.trigger( event );
+ deepEqual( menu.find( ".ui-menu-item:has(.ui-state-focus)" ).length, 1, "menu item is active" );
+
+ event = $.Event( "keydown" );
+ event.keyCode = $.ui.keyCode.ENTER;
+ element.trigger( event );
+ ok( event.isDefaultPrevented(), "default action is prevented" );
+});
+
+test( "allow form submit on enter when menu is not active", function() {
+ expect( 1 );
+ var event,
+ element = $( "#autocomplete" )
+ .autocomplete({
+ autoFocus: false,
+ source: [ "java", "javascript" ]
+ })
+ .val( "ja" )
+ .autocomplete( "search" );
+
+ event = $.Event( "keydown" );
+ event.keyCode = $.ui.keyCode.ENTER;
+ element.trigger( event );
+ ok( !event.isDefaultPrevented(), "default action is prevented" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js
new file mode 100644
index 0000000..ac83eae
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js
@@ -0,0 +1,25 @@
+commonWidgetTests( "autocomplete", {
+ defaults: {
+ appendTo: "body",
+ autoFocus: false,
+ delay: 300,
+ disabled: false,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ create: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js
new file mode 100644
index 0000000..7b51ec4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js
@@ -0,0 +1,179 @@
+(function( $ ) {
+
+module( "autocomplete: events" );
+
+var data = [ "Clojure", "COBOL", "ColdFusion", "Java", "JavaScript", "Scala", "Scheme" ];
+
+$.each([
+ {
+ type: "input",
+ selector: "#autocomplete",
+ valueMethod: "val"
+ },
+ {
+ type: "textarea",
+ selector: "#autocomplete-textarea",
+ valueMethod: "val"
+ },
+ {
+ type: "contenteditable",
+ selector: "#autocomplete-contenteditable",
+ valueMethod: "text"
+ }
+], function( i, settings ) {
+ asyncTest( "all events - " + settings.type, function() {
+ expect( 13 );
+ var element = $( settings.selector )
+ .autocomplete({
+ autoFocus: false,
+ delay: 0,
+ source: data,
+ search: function( event ) {
+ equal( event.originalEvent.type, "keydown", "search originalEvent" );
+ },
+ response: function( event, ui ) {
+ deepEqual( ui.content, [
+ { label: "Clojure", value: "Clojure" },
+ { label: "Java", value: "Java" },
+ { label: "JavaScript", value: "JavaScript" }
+ ], "response ui.content" );
+ ui.content.splice( 0, 1 );
+ },
+ open: function( event ) {
+ ok( menu.is( ":visible" ), "menu open on open" );
+ },
+ focus: function( event, ui ) {
+ equal( event.originalEvent.type, "menufocus", "focus originalEvent" );
+ deepEqual( ui.item, { label: "Java", value: "Java" }, "focus ui.item" );
+ },
+ close: function( event ) {
+ equal( event.originalEvent.type, "menuselect", "close originalEvent" );
+ ok( menu.is( ":hidden" ), "menu closed on close" );
+ },
+ select: function( event, ui ) {
+ equal( event.originalEvent.type, "menuselect", "select originalEvent" );
+ deepEqual( ui.item, { label: "Java", value: "Java" }, "select ui.item" );
+ },
+ change: function( event, ui ) {
+ equal( event.originalEvent.type, "blur", "change originalEvent" );
+ deepEqual( ui.item, { label: "Java", value: "Java" }, "change ui.item" );
+ ok( menu.is( ":hidden" ), "menu closed on change" );
+ start();
+ }
+ }),
+ menu = element.autocomplete( "widget" );
+
+ element.simulate( "focus" )[ settings.valueMethod ]( "j" ).keydown();
+ setTimeout(function() {
+ ok( menu.is( ":visible" ), "menu is visible after delay" );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ element.simulate( "blur" );
+ }, 50 );
+ });
+});
+
+asyncTest( "change without selection", function() {
+ expect( 1 );
+ var element = $( "#autocomplete" ).autocomplete({
+ delay: 0,
+ source: data,
+ change: function( event, ui ) {
+ strictEqual( ui.item, null );
+ start();
+ }
+ });
+ element.triggerHandler( "focus" );
+ element.val( "ja" ).triggerHandler( "blur" );
+});
+
+asyncTest( "cancel search", function() {
+ expect( 6 );
+ var first = true,
+ element = $( "#autocomplete" ).autocomplete({
+ delay: 0,
+ source: data,
+ search: function() {
+ if ( first ) {
+ equal( element.val(), "ja", "val on first search" );
+ first = false;
+ return false;
+ }
+ equal( element.val(), "java", "val on second search" );
+ },
+ open: function() {
+ ok( true, "menu opened" );
+ }
+ }),
+ menu = element.autocomplete( "widget" );
+ element.val( "ja" ).keydown();
+ setTimeout(function() {
+ ok( menu.is( ":hidden" ), "menu is hidden after first search" );
+ element.val( "java" ).keydown();
+ setTimeout(function() {
+ ok( menu.is( ":visible" ), "menu is visible after second search" );
+ equal( menu.find( ".ui-menu-item" ).length, 2, "# of menu items" );
+ start();
+ }, 50 );
+ }, 50 );
+});
+
+asyncTest( "cancel focus", function() {
+ expect( 1 );
+ var customVal = "custom value";
+ element = $( "#autocomplete" ).autocomplete({
+ delay: 0,
+ source: data,
+ focus: function( event, ui ) {
+ $( this ).val( customVal );
+ return false;
+ }
+ });
+ element.val( "ja" ).keydown();
+ setTimeout(function() {
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ equal( element.val(), customVal );
+ start();
+ }, 50 );
+});
+
+asyncTest( "cancel select", function() {
+ expect( 1 );
+ var customVal = "custom value",
+ element = $( "#autocomplete" ).autocomplete({
+ delay: 0,
+ source: data,
+ select: function( event, ui ) {
+ $( this ).val( customVal );
+ return false;
+ }
+ });
+ element.val( "ja" ).keydown();
+ setTimeout(function() {
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equal( element.val(), customVal );
+ start();
+ }, 50 );
+});
+
+asyncTest( "blur during remote search", function() {
+ expect( 1 );
+ var ac = $( "#autocomplete" ).autocomplete({
+ delay: 0,
+ source: function( request, response ) {
+ ok( true, "trigger request" );
+ ac.simulate( "blur" );
+ setTimeout(function() {
+ response([ "result" ]);
+ start();
+ }, 100 );
+ },
+ open: function() {
+ ok( false, "opened after a blur" );
+ }
+ });
+ ac.val( "ro" ).keydown();
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js
new file mode 100644
index 0000000..3fe035d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js
@@ -0,0 +1,30 @@
+(function( $ ) {
+
+module( "autocomplete: methods" );
+
+test( "destroy", function() {
+ expect( 1 );
+ domEqual( "#autocomplete", function() {
+ $( "#autocomplete" ).autocomplete().autocomplete( "destroy" );
+ });
+});
+
+test( "search", function() {
+ expect( 3 );
+ var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ],
+ element = $( "#autocomplete" ).autocomplete({
+ source: data,
+ minLength: 0
+ }),
+ menu = element.autocomplete( "widget" );
+ element.autocomplete( "search" );
+ equal( menu.find( ".ui-menu-item" ).length, data.length, "all items for a blank search" );
+
+ element.val( "has" ).autocomplete( "search" );
+ equal( menu.find( ".ui-menu-item" ).text(), "haskell", "only one item for set input value" );
+
+ element.autocomplete( "search", "ja" );
+ equal( menu.find( ".ui-menu-item" ).length, 2, "only java and javascript for 'ja'" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js
new file mode 100644
index 0000000..114e9a4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js
@@ -0,0 +1,193 @@
+(function( $ ) {
+
+module( "autocomplete: options" );
+
+var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ];
+
+test( "appendTo", function() {
+ expect( 5 );
+ var element = $( "#autocomplete" ).autocomplete();
+ equal( element.autocomplete( "widget" ).parent()[0], document.body, "defaults to body" );
+ element.autocomplete( "destroy" );
+
+ element.autocomplete({
+ appendTo: ".ac-wrap"
+ });
+ equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "first found element" );
+ equal( $( "#ac-wrap2 .ui-autocomplete" ).length, 0, "only appends to one element" );
+ element.autocomplete( "destroy" );
+
+ element.autocomplete({
+ appendTo: null
+ });
+ equal( element.autocomplete( "widget" ).parent()[0], document.body, "null" );
+ element.autocomplete( "destroy" );
+
+ element.autocomplete().autocomplete( "option", "appendTo", "#ac-wrap1" );
+ equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "modified after init" );
+ element.autocomplete( "destroy" );
+});
+
+function autoFocusTest( afValue, focusedLength ) {
+ var element = $( "#autocomplete" ).autocomplete({
+ autoFocus: afValue,
+ delay: 0,
+ source: data,
+ open: function( event, ui ) {
+ equal( element.autocomplete( "widget" ).children( ".ui-menu-item:first" ).find( ".ui-state-focus" ).length,
+ focusedLength, "first item is " + (afValue ? "" : "not") + " auto focused" );
+ start();
+ }
+ });
+ element.val( "ja" ).keydown();
+ stop();
+}
+
+test( "autoFocus: false", function() {
+ expect( 1 );
+ autoFocusTest( false, 0 );
+});
+
+test( "autoFocus: true", function() {
+ expect( 1 );
+ autoFocusTest( true, 1 );
+});
+
+asyncTest( "delay", function() {
+ expect( 2 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: data,
+ delay: 50
+ }),
+ menu = element.autocomplete( "widget" );
+ element.val( "ja" ).keydown();
+
+ ok( menu.is( ":hidden" ), "menu is closed immediately after search" );
+
+ setTimeout(function() {
+ ok( menu.is( ":visible" ), "menu is open after delay" );
+ start();
+ }, 100 );
+});
+
+asyncTest( "disabled", function() {
+ expect( 2 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: data,
+ delay: 0,
+ disabled: true
+ }),
+ menu = element.autocomplete( "widget" );
+ element.val( "ja" ).keydown();
+
+ ok( menu.is( ":hidden" ) );
+
+ setTimeout(function() {
+ ok( menu.is( ":hidden" ) );
+ start();
+ }, 50 );
+});
+
+test( "minLength", function() {
+ expect( 2 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: data
+ }),
+ menu = element.autocomplete( "widget" );
+ element.autocomplete( "search", "" );
+ ok( menu.is( ":hidden" ), "blank not enough for minLength: 1" );
+
+ element.autocomplete( "option", "minLength", 0 );
+ element.autocomplete( "search", "" );
+ ok( menu.is( ":visible" ), "blank enough for minLength: 0" );
+});
+
+test( "source, local string array", function() {
+ expect( 1 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: data
+ }),
+ menu = element.autocomplete( "widget" );
+ element.val( "ja" ).autocomplete( "search" );
+ equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" );
+});
+
+function sourceTest( source, async ) {
+ var element = $( "#autocomplete" ).autocomplete({
+ source: source
+ }),
+ menu = element.autocomplete( "widget" );
+ function result() {
+ equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" );
+ element.autocomplete( "destroy" );
+ if ( async ) {
+ start();
+ }
+ }
+ if ( async ) {
+ stop();
+ $( document ).one( "ajaxStop", result );
+ }
+ element.val( "ja" ).autocomplete( "search" );
+ if ( !async ) {
+ result();
+ }
+}
+
+test( "source, local object array, only label property", function() {
+ expect( 1 );
+ sourceTest([
+ { label: "java" },
+ { label: "php" },
+ { label: "coldfusion" },
+ { label: "javascript" }
+ ]);
+});
+
+test( "source, local object array, only value property", function() {
+ expect( 1 );
+ sourceTest([
+ { value: "java" },
+ { value: "php" },
+ { value: "coldfusion" },
+ { value: "javascript" }
+ ]);
+});
+
+test( "source, url string with remote json string array", function() {
+ expect( 1 );
+ sourceTest( "remote_string_array.txt", true );
+});
+
+test( "source, url string with remote json object array, only value properties", function() {
+ expect( 1 );
+ sourceTest( "remote_object_array_values.txt", true );
+});
+
+test( "source, url string with remote json object array, only label properties", function() {
+ expect( 1 );
+ sourceTest( "remote_object_array_labels.txt", true );
+});
+
+test( "source, custom", function() {
+ expect( 2 );
+ sourceTest(function( request, response ) {
+ equal( request.term, "ja" );
+ response( ["java", "javascript"] );
+ });
+});
+
+test( "source, update after init", function() {
+ expect( 2 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: [ "java", "javascript", "haskell" ]
+ }),
+ menu = element.autocomplete( "widget" );
+ element.val( "ja" ).autocomplete( "search" );
+ equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" );
+ element.autocomplete( "option", "source", [ "php", "asp" ] );
+ element.val( "ph" ).autocomplete( "search" );
+ equal( menu.find( ".ui-menu-item" ).text(), "php" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt
new file mode 100644
index 0000000..502496c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt
@@ -0,0 +1 @@
+[{"label":"java"},{"label":"javascript"}] \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt
new file mode 100644
index 0000000..029cbb9
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt
@@ -0,0 +1 @@
+[{"value":"java"},{"value":"javascript"}] \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt
new file mode 100644
index 0000000..3b24c8e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt
@@ -0,0 +1 @@
+["java", "javascript"] \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html
new file mode 100644
index 0000000..fa9e224
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Button Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "button" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Button Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html
new file mode 100644
index 0000000..5ec7e31
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html
@@ -0,0 +1,71 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Button Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.button" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.button.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="button_core.js"></script>
+ <script src="button_defaults.js"></script>
+ <script src="button_events.js"></script>
+ <script src="button_methods.js"></script>
+ <script src="button_options.js"></script>
+ <script src="button_tickets.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Button Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div><button id="button" class="foo">Label</button></div>
+
+<div id="radio0" style="margin-top: 2em;">
+ <input type="radio" id="radio01" name="radio" checked="checked"><label for="radio01">Choice 1</label>
+ <input type="radio" id="radio02" name="radio"><label for="radio02">Choice 2</label>
+ <input type="radio" id="radio03" name="radio"><label for="radio03">Choice 3</label>
+</div>
+<form>
+ <div id="radio1" style="margin-top: 2em;">
+ <input type="radio" id="radio11" name="radio"><label for="radio11">Choice 1</label>
+ <input type="radio" id="radio12" name="radio" checked="checked"><label for="radio12">Choice 2</label>
+ <input type="radio" id="radio13" name="radio"><label for="radio13">Choice 3</label>
+ </div>
+</form>
+<form>
+ <div id="radio2" style="margin-top: 2em;">
+ <input type="radio" id="radio21" name="radio"><label for="radio21">Choice 1</label>
+ <input type="radio" id="radio22" name="radio"><label for="radio22">Choice 2</label>
+ <input type="radio" id="radio23" name="radio" checked="checked"><label for="radio23">Choice 3</label>
+ </div>
+</form>
+
+<input type="checkbox" id="check"><label for="check">Toggle</label>
+
+<div><input id="submit" type="submit" value="Label"></div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js
new file mode 100644
index 0000000..692c403
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js
@@ -0,0 +1,84 @@
+/*
+ * button_core.js
+ */
+
+
+(function($) {
+
+module("button: core");
+
+test("checkbox", function() {
+ var input = $("#check");
+ label = $("label[for=check]");
+ ok( input.is(":visible") );
+ ok( label.is(":not(.ui-button)") );
+ input.button();
+ ok( input.is(".ui-helper-hidden-accessible") );
+ ok( label.is(".ui-button") );
+});
+
+test("radios", function() {
+ var inputs = $("#radio0 input");
+ labels = $("#radio0 label");
+ ok( inputs.is(":visible") );
+ ok( labels.is(":not(.ui-button)") );
+ inputs.button();
+ ok( inputs.is(".ui-helper-hidden-accessible") );
+ ok( labels.is(".ui-button") );
+});
+
+function assert(noForm, form1, form2) {
+ ok( $("#radio0 .ui-button" + noForm).is(".ui-state-active") );
+ ok( $("#radio1 .ui-button" + form1).is(".ui-state-active") );
+ ok( $("#radio2 .ui-button" + form2).is(".ui-state-active") );
+}
+
+test("radio groups", function() {
+ $(":radio").button();
+ assert(":eq(0)", ":eq(1)", ":eq(2)");
+
+ // click outside of forms
+ $("#radio0 .ui-button:eq(1)").click();
+ assert(":eq(1)", ":eq(1)", ":eq(2)");
+
+ // click in first form
+ $("#radio1 .ui-button:eq(0)").click();
+ assert(":eq(1)", ":eq(0)", ":eq(2)");
+
+ // click in second form
+ $("#radio2 .ui-button:eq(0)").click();
+ assert(":eq(1)", ":eq(0)", ":eq(0)");
+});
+
+test("input type submit, don't create child elements", function() {
+ var input = $("#submit")
+ same( input.children().length, 0 );
+ input.button();
+ same( input.children().length, 0 );
+});
+
+test("buttonset", function() {
+ var set = $("#radio1").buttonset();
+ ok( set.is(".ui-buttonset") );
+ same( set.children(".ui-button").length, 3 );
+ same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 );
+ ok( set.children("label:eq(0)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") );
+ ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") );
+ ok( set.children("label:eq(2)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") );
+});
+
+test("buttonset (rtl)", function() {
+ var parent = $("#radio1").parent();
+ // Set to rtl
+ parent.attr("dir", "rtl");
+
+ var set = $("#radio1").buttonset();
+ ok( set.is(".ui-buttonset") );
+ same( set.children(".ui-button").length, 3 );
+ same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 );
+ ok( set.children("label:eq(0)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") );
+ ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") );
+ ok( set.children("label:eq(2)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js
new file mode 100644
index 0000000..96c7e5b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js
@@ -0,0 +1,14 @@
+commonWidgetTests( "button", {
+ defaults: {
+ disabled: null,
+ icons: {
+ primary: null,
+ secondary: null
+ },
+ label: null,
+ text: true,
+
+ // callbacks
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js
new file mode 100644
index 0000000..a215402
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js
@@ -0,0 +1,8 @@
+/*
+ * button_events.js
+ */
+(function($) {
+
+module("button: events");
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js
new file mode 100644
index 0000000..a83a73b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js
@@ -0,0 +1,19 @@
+/*
+ * button_methods.js
+ */
+(function($) {
+
+
+module("button: methods");
+
+test("destroy", function() {
+ var beforeHtml = $("#button").parent().html();
+ var afterHtml = $("#button").button().button("destroy").parent().html();
+ // Opera 9 outputs role="" instead of removing the attribute like everyone else
+ if ($.browser.opera) {
+ afterHtml = afterHtml.replace(/ role=""/g, "");
+ }
+ equal( afterHtml, beforeHtml );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js
new file mode 100644
index 0000000..a3ab5ae
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js
@@ -0,0 +1,93 @@
+/*
+ * button_options.js
+ */
+(function($) {
+
+module("button: options");
+
+test("disabled, explicit value", function() {
+ $("#radio01").button({ disabled: false });
+ same(false, $("#radio01").button("option", "disabled"),
+ "disabled option set to false");
+ same(false, $("#radio01").prop("disabled"), "element is disabled");
+
+ $("#radio02").button({ disabled: true });
+ same(true, $("#radio02").button("option", "disabled"),
+ "disabled option set to true");
+ same(true, $("#radio02").prop("disabled"), "element is not disabled");
+});
+
+test("disabled, null", function() {
+ $("#radio01").button({ disabled: null });
+ same(false, $("#radio01").button("option", "disabled"),
+ "disabled option set to false");
+ same(false, $("#radio01").prop("disabled"), "element is disabled");
+
+ $("#radio02").prop("disabled", true).button({ disabled: null });
+ same(true, $("#radio02").button("option", "disabled"),
+ "disabled option set to true");
+ same(true, $("#radio02").prop("disabled"), "element is not disabled");
+});
+
+test("text false without icon", function() {
+ $("#button").button({
+ text: false
+ });
+ ok( $("#button").is(".ui-button-text-only:not(.ui-button-icon-only)") );
+
+ $("#button").button("destroy");
+});
+
+test("text false with icon", function() {
+ $("#button").button({
+ text: false,
+ icons: {
+ primary: "iconclass"
+ }
+ });
+ ok( $("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)") );
+
+ $("#button").button("destroy");
+});
+
+test("label, default", function() {
+ $("#button").button();
+ same( $("#button").text(), "Label" );
+
+ $("#button").button("destroy");
+});
+
+test("label", function() {
+ $("#button").button({
+ label: "xxx"
+ });
+ same( $("#button").text(), "xxx" );
+
+ $("#button").button("destroy");
+});
+
+test("label default with input type submit", function() {
+ same( $("#submit").button().val(), "Label" );
+});
+
+test("label with input type submit", function() {
+ var label = $("#submit").button({
+ label: "xxx"
+ }).val();
+ same( label, "xxx" );
+});
+
+test("icons", function() {
+ $("#button").button({
+ text: false,
+ icons: {
+ primary: "iconclass",
+ secondary: "iconclass2"
+ }
+ });
+ ok( $("#button").is(":has(span.ui-icon.ui-button-icon-primary.iconclass):has(span.ui-icon.ui-button-icon-secondary.iconclass2)") );
+
+ $("#button").button("destroy");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js
new file mode 100644
index 0000000..624d167
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js
@@ -0,0 +1,59 @@
+/*
+ * button_tickets.js
+ */
+(function( $ ) {
+
+module( "button: tickets" );
+
+test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
+ $( "#radio01" ).next().andSelf().hide();
+ var set = $( "#radio0" ).buttonset({ items: ":radio:visible" });
+ ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
+ ok( set.find( "label:eq(1)" ).is( ".ui-button.ui-corner-left" ) );
+});
+
+test( "#6262 - buttonset not applying ui-corner to invisible elements", function() {
+ $( "#radio0" ).hide();
+ var set = $( "#radio0" ).buttonset();
+ ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) );
+ ok( set.find( "label:eq(1)" ).is( ".ui-button" ) );
+ ok( set.find( "label:eq(2)" ).is( ".ui-button.ui-corner-right" ) );
+});
+
+test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() {
+ var check = $( "#check" ).button(),
+ label = $( "label[for='check']" );
+ ok( !label.is( ".ui-state-focus" ) );
+ check.focus();
+ ok( label.is( ".ui-state-focus" ) );
+});
+
+test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
+ var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+
+ group = $( "<input type='checkbox' id='t7092b'><label for='t7092b'></label>" );
+ group.filter( "input:checkbox" ).button();
+ ok( group.filter( "label" ).is( ".ui-button" ) );
+
+ group = $( "<span><input type='checkbox' id='t7092c'></span><label for='t7092c'></label>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.filter( "label" ).is( ".ui-button" ) );
+
+ group = $( "<span><input type='checkbox' id='t7092d'></span><span><label for='t7092d'></label></span>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+
+ group = $( "<input type='checkbox' id='t7092e'><span><label for='t7092e'></label></span>" );
+ group.filter( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+});
+
+test( "#7534 - Button label selector works for ids with \":\"", function() {
+ var group = $( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" );
+ group.find( "input" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html
new file mode 100644
index 0000000..e8d84e1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Core Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "core" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Core Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html
new file mode 100644
index 0000000..3b1dc1f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html
@@ -0,0 +1,134 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Core Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ js: [ "ui/jquery.ui.core.js" ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="core.js"></script>
+ <script src="selector.js"></script>
+
+ <script src="../swarminject.js"></script>
+ <style>
+ .zindex {
+ z-index: 100;
+ }
+ .absolute {
+ position: absolute;
+ }
+ </style>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Core Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<img src="../images/jqueryui_32x32.png" usemap="#mymap" width="10", height="10">
+<map name="mymap">
+ <area shape="rect" coords="0,0,1,1" id="areaCoordsNoHref">
+ <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaCoordsHref">
+ <area shape="rect" coords="0,0,0,0" href="foo.html" id="areaCoordsNoSizeHref">
+ <area href="foo.html" id="areaNoCoordsHref">
+</map>
+<map name="mymap2">
+ <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaNoImg">
+</map>
+
+<form id="formNoTabindex"></form>
+<form id="formTabindex" tabindex="1"></form>
+
+<div>
+ <input id="visibleAncestor-inputTypeNone">
+ <input type="text" id="visibleAncestor-inputTypeText">
+ <input type="checkbox" id="visibleAncestor-inputTypeCheckbox">
+ <input type="radio" id="visibleAncestor-inputTypeRadio">
+ <input type="button" id="visibleAncestor-inputTypeButton">
+ <input type="hidden" id="visibleAncestor-inputTypeHidden">
+ <button id="visibleAncestor-button">x</button>
+ <select id="visibleAncestor-select">
+ <option>option</option>
+ </select>
+ <textarea id="visibleAncestor-textarea">x</textarea>
+ <object id="visibleAncestor-object" codebase="about:blank">xxx</object>
+ <a href="#" id="visibleAncestor-anchorWithHref">anchor</a>
+ <a id="visibleAncestor-anchorWithoutHref">anchor</a>
+ <span id="visibleAncestor-span">x</span>
+ <div id="visibleAncestor-div">x</div>
+ <span id="visibleAncestor-spanWithTabindex" tabindex="1">x</span>
+ <div id="visibleAncestor-divWithNegativeTabindex" tabindex="-1">x</div>
+</div>
+
+<div>
+ <input id="disabledElement-inputTypeNone" disabled="disabled">
+ <input type="text" id="disabledElement-inputTypeText" disabled="disabled">
+ <input type="checkbox" id="disabledElement-inputTypeCheckbox" disabled="disabled">
+ <input type="radio" id="disabledElement-inputTypeRadio" disabled="disabled">
+ <input type="button" id="disabledElement-inputTypeButton" disabled="disabled">
+ <input type="hidden" id="disabledElement-inputTypeHidden" disabled="disabled">
+ <button id="disabledElement-button" disabled="disabled"></button>
+ <select id="disabledElement-select" disabled="disabled"></select>
+ <textarea id="disabledElement-textarea" disabled="disabled"></textarea>
+</div>
+
+<div>
+ <div id="displayNoneAncestor" style="display: none;">
+ <input id="displayNoneAncestor-input">
+ <span tabindex="1" id="displayNoneAncestor-span">.</span>
+ </div>
+
+ <div id="visibilityHiddenAncestor" style="visibility: hidden;">
+ <input id="visibilityHiddenAncestor-input">
+ <span tabindex="1" id="visibilityHiddenAncestor-span">.</span>
+ </div>
+
+ <span tabindex="1" id="displayNone-span" style="display: none;">.</span>
+ <span tabindex="1" id="visibilityHidden-span" style="visibility: hidden;">.</span>
+
+ <input id="displayNone-input" style="display: none;">
+ <input id="visibilityHidden-input" style="visibility: hidden;">
+</div>
+
+<div>
+ <input id="inputTabindex0" tabindex="0">
+ <input id="inputTabindex10" tabindex="10">
+ <input id="inputTabindex-1" tabindex="-1">
+ <input id="inputTabindex-50" tabindex="-50">
+
+ <span id="spanTabindex0" tabindex="0">.</span>
+ <span id="spanTabindex10" tabindex="10">.</span>
+ <span id="spanTabindex-1" tabindex="-1">.</span>
+ <span id="spanTabindex-50" tabindex="-50">.</span>
+</div>
+
+<div id="zIndex100" style="z-index: 100; position: absolute">
+ <div id="zIndexAutoWithParent">.</div>
+</div>
+<div id="zIndex100ViaCSS" class="zindex">
+ <div id="zIndexAutoWithParentViaCSS">.</div>
+</div>
+<div id="zIndex100ViaCSSPositioned" class="zindex absolute">
+ <div id="zIndexAutoWithParentViaCSSPositioned">.</div>
+</div>
+<div id="zIndexAutoNoParent"></div>
+
+<div id="dimensions" style="float: left; height: 50px; width: 100px; margin: 1px 12px 11px 2px; border-style: solid; border-width: 3px 14px 13px 4px; padding: 5px 16px 15px 6px;"></div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js
new file mode 100644
index 0000000..03a7ab8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js
@@ -0,0 +1,157 @@
+/*
+ * core unit tests
+ */
+(function($) {
+
+module('core - jQuery extensions');
+
+test('focus - original functionality', function() {
+ expect(1);
+
+ $('#inputTabindex0')
+ .focus(function() {
+ ok(true, 'event triggered');
+ })
+ .focus();
+});
+
+asyncTest('focus', function() {
+ expect(2);
+ $('#inputTabindex0')
+ .focus(function() {
+ ok(true, 'event triggered');
+ })
+ .focus(500, function() {
+ ok(true, 'callback triggered');
+ $(this).unbind('focus');
+ start();
+ });
+});
+
+test('zIndex', function() {
+ var el = $('#zIndexAutoWithParent'),
+ parent = el.parent();
+ equals(el.zIndex(), 100, 'zIndex traverses up to find value');
+ equals(parent.zIndex(200), parent, 'zIndex setter is chainable');
+ equals(el.zIndex(), 200, 'zIndex setter changed zIndex');
+
+ el = $('#zIndexAutoWithParentViaCSS');
+ equals(el.zIndex(), 0, 'zIndex traverses up to find CSS value, not found because not positioned');
+
+ el = $('#zIndexAutoWithParentViaCSSPositioned');
+ equals(el.zIndex(), 100, 'zIndex traverses up to find CSS value');
+ el.parent().zIndex(200);
+ equals(el.zIndex(), 200, 'zIndex setter changed zIndex, overriding CSS');
+
+ equals($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy');
+});
+
+test( "innerWidth - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.innerWidth(), 122, "getter passthru" );
+ el.hide();
+ equals( el.innerWidth(), 122, "getter passthru when hidden" );
+});
+
+test( "innerWidth - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.innerWidth( 120 );
+ equals( el.width(), 98, "width set properly" );
+ el.hide();
+ el.innerWidth( 100 );
+ equals( el.width(), 78, "width set properly when hidden" );
+});
+
+test( "innerHeight - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.innerHeight(), 70, "getter passthru" );
+ el.hide();
+ equals( el.innerHeight(), 70, "getter passthru when hidden" );
+});
+
+test( "innerHeight - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.innerHeight( 60 );
+ equals( el.height(), 40, "height set properly" );
+ el.hide();
+ el.innerHeight( 50 );
+ equals( el.height(), 30, "height set properly when hidden" );
+});
+
+test( "outerWidth - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.outerWidth(), 140, "getter passthru" );
+ el.hide();
+ equals( el.outerWidth(), 140, "getter passthru when hidden" );
+});
+
+test( "outerWidth - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.outerWidth( 130 );
+ equals( el.width(), 90, "width set properly" );
+ el.hide();
+ el.outerWidth( 120 );
+ equals( el.width(), 80, "width set properly when hidden" );
+});
+
+test( "outerWidth(true) - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.outerWidth(true), 154, "getter passthru w/ margin" );
+ el.hide();
+ equals( el.outerWidth(true), 154, "getter passthru w/ margin when hidden" );
+});
+
+test( "outerWidth(true) - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.outerWidth( 130, true );
+ equals( el.width(), 76, "width set properly" );
+ el.hide();
+ el.outerWidth( 120, true );
+ equals( el.width(), 66, "width set properly when hidden" );
+});
+
+test( "outerHeight - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.outerHeight(), 86, "getter passthru" );
+ el.hide();
+ equals( el.outerHeight(), 86, "getter passthru when hidden" );
+});
+
+test( "outerHeight - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.outerHeight( 80 );
+ equals( el.height(), 44, "height set properly" );
+ el.hide();
+ el.outerHeight( 70 );
+ equals( el.height(), 34, "height set properly when hidden" );
+});
+
+test( "outerHeight(true) - getter", function() {
+ var el = $( "#dimensions" );
+
+ equals( el.outerHeight(true), 98, "getter passthru w/ margin" );
+ el.hide();
+ equals( el.outerHeight(true), 98, "getter passthru w/ margin when hidden" );
+});
+
+test( "outerHeight(true) - setter", function() {
+ var el = $( "#dimensions" );
+
+ el.outerHeight( 90, true );
+ equals( el.height(), 42, "height set properly" );
+ el.hide();
+ el.outerHeight( 80, true );
+ equals( el.height(), 32, "height set properly when hidden" );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js
new file mode 100644
index 0000000..2fb7802
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js
@@ -0,0 +1,239 @@
+/*
+ * selector unit tests
+ */
+(function($) {
+
+module("core - selectors");
+
+function isFocusable(selector, msg) {
+ ok($(selector).is(':focusable'), msg + " - selector " + selector + " is focusable");
+}
+
+function isNotFocusable(selector, msg) {
+ ok($(selector).length && !$(selector).is(':focusable'), msg + " - selector " + selector + " is not focusable");
+}
+
+function isTabbable(selector, msg) {
+ ok($(selector).is(':tabbable'), msg + " - selector " + selector + " is tabbable");
+}
+
+function isNotTabbable(selector, msg) {
+ ok($(selector).length && !$(selector).is(':tabbable'), msg + " - selector " + selector + " is not tabbable");
+}
+
+test("data", function() {
+ expect(15);
+
+ var el;
+ function shouldHaveData(msg) {
+ ok(el.is(':data(test)'), msg);
+ }
+ function shouldNotHaveData(msg) {
+ ok(!el.is(':data(test)'), msg);
+ }
+
+ el = $('<div>');
+ shouldNotHaveData('data never set');
+
+ el = $('<div>').data('test', null);
+ shouldNotHaveData('data is null');
+
+ el = $('<div>').data('test', true);
+ shouldHaveData('data set to true');
+
+ el = $('<div>').data('test', false);
+ shouldNotHaveData('data set to false');
+
+ el = $('<div>').data('test', 0);
+ shouldNotHaveData('data set to 0');
+
+ el = $('<div>').data('test', 1);
+ shouldHaveData('data set to 1');
+
+ el = $('<div>').data('test', '');
+ shouldNotHaveData('data set to empty string');
+
+ el = $('<div>').data('test', 'foo');
+ shouldHaveData('data set to string');
+
+ el = $('<div>').data('test', []);
+ shouldHaveData('data set to empty array');
+
+ el = $('<div>').data('test', [1]);
+ shouldHaveData('data set to array');
+
+ el = $('<div>').data('test', {});
+ shouldHaveData('data set to empty object');
+
+ el = $('<div>').data('test', {foo: 'bar'});
+ shouldHaveData('data set to object');
+
+ el = $('<div>').data('test', new Date());
+ shouldHaveData('data set to date');
+
+ el = $('<div>').data('test', /test/);
+ shouldHaveData('data set to regexp');
+
+ el = $('<div>').data('test', function() {});
+ shouldHaveData('data set to function');
+});
+
+test("focusable - visible, enabled elements", function() {
+ expect(18);
+
+ isNotFocusable('#formNoTabindex', 'form');
+ isFocusable('#formTabindex', 'form with tabindex');
+ isFocusable('#visibleAncestor-inputTypeNone', 'input, no type');
+ isFocusable('#visibleAncestor-inputTypeText', 'input, type text');
+ isFocusable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox');
+ isFocusable('#visibleAncestor-inputTypeRadio', 'input, type radio');
+ isFocusable('#visibleAncestor-inputTypeButton', 'input, type button');
+ isNotFocusable('#visibleAncestor-inputTypeHidden', 'input, type hidden');
+ isFocusable('#visibleAncestor-button', 'button');
+ isFocusable('#visibleAncestor-select', 'select');
+ isFocusable('#visibleAncestor-textarea', 'textarea');
+ isFocusable('#visibleAncestor-object', 'object');
+ isFocusable('#visibleAncestor-anchorWithHref', 'anchor with href');
+ isNotFocusable('#visibleAncestor-anchorWithoutHref', 'anchor without href');
+ isNotFocusable('#visibleAncestor-span', 'span');
+ isNotFocusable('#visibleAncestor-div', 'div');
+ isFocusable("#visibleAncestor-spanWithTabindex", 'span with tabindex');
+ isFocusable("#visibleAncestor-divWithNegativeTabindex", 'div with tabindex');
+});
+
+test("focusable - disabled elements", function() {
+ expect(9);
+
+ isNotFocusable('#disabledElement-inputTypeNone', 'input, no type');
+ isNotFocusable('#disabledElement-inputTypeText', 'input, type text');
+ isNotFocusable('#disabledElement-inputTypeCheckbox', 'input, type checkbox');
+ isNotFocusable('#disabledElement-inputTypeRadio', 'input, type radio');
+ isNotFocusable('#disabledElement-inputTypeButton', 'input, type button');
+ isNotFocusable('#disabledElement-inputTypeHidden', 'input, type hidden');
+ isNotFocusable('#disabledElement-button', 'button');
+ isNotFocusable('#disabledElement-select', 'select');
+ isNotFocusable('#disabledElement-textarea', 'textarea');
+});
+
+test("focusable - hidden styles", function() {
+ expect(8);
+
+ isNotFocusable('#displayNoneAncestor-input', 'input, display: none parent');
+ isNotFocusable('#displayNoneAncestor-span', 'span with tabindex, display: none parent');
+
+ isNotFocusable('#visibilityHiddenAncestor-input', 'input, visibility: hidden parent');
+ isNotFocusable('#visibilityHiddenAncestor-span', 'span with tabindex, visibility: hidden parent');
+
+ isNotFocusable('#displayNone-input', 'input, display: none');
+ isNotFocusable('#visibilityHidden-input', 'input, visibility: hidden');
+
+ isNotFocusable('#displayNone-span', 'span with tabindex, display: none');
+ isNotFocusable('#visibilityHidden-span', 'span with tabindex, visibility: hidden');
+});
+
+test("focusable - natively focusable with various tabindex", function() {
+ expect(4);
+
+ isFocusable('#inputTabindex0', 'input, tabindex 0');
+ isFocusable('#inputTabindex10', 'input, tabindex 10');
+ isFocusable('#inputTabindex-1', 'input, tabindex -1');
+ isFocusable('#inputTabindex-50', 'input, tabindex -50');
+});
+
+test("focusable - not natively focusable with various tabindex", function() {
+ expect(4);
+
+ isFocusable('#spanTabindex0', 'span, tabindex 0');
+ isFocusable('#spanTabindex10', 'span, tabindex 10');
+ isFocusable('#spanTabindex-1', 'span, tabindex -1');
+ isFocusable('#spanTabindex-50', 'span, tabindex -50');
+});
+
+test("focusable - area elements", function() {
+ isNotFocusable('#areaCoordsNoHref', 'coords but no href');
+ isFocusable('#areaCoordsHref', 'coords and href');
+ isFocusable('#areaCoordsNoSizeHref', 'coords of zero px and href');
+ isFocusable('#areaNoCoordsHref', 'href but no coords');
+ isNotFocusable('#areaNoImg', 'not associated with an image');
+});
+
+test("tabbable - visible, enabled elements", function() {
+ expect(18);
+
+ isNotTabbable('#formNoTabindex', 'form');
+ isTabbable('#formTabindex', 'form with tabindex');
+ isTabbable('#visibleAncestor-inputTypeNone', 'input, no type');
+ isTabbable('#visibleAncestor-inputTypeText', 'input, type text');
+ isTabbable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox');
+ isTabbable('#visibleAncestor-inputTypeRadio', 'input, type radio');
+ isTabbable('#visibleAncestor-inputTypeButton', 'input, type button');
+ isNotTabbable('#visibleAncestor-inputTypeHidden', 'input, type hidden');
+ isTabbable('#visibleAncestor-button', 'button');
+ isTabbable('#visibleAncestor-select', 'select');
+ isTabbable('#visibleAncestor-textarea', 'textarea');
+ isTabbable('#visibleAncestor-object', 'object');
+ isTabbable('#visibleAncestor-anchorWithHref', 'anchor with href');
+ isNotTabbable('#visibleAncestor-anchorWithoutHref', 'anchor without href');
+ isNotTabbable('#visibleAncestor-span', 'span');
+ isNotTabbable('#visibleAncestor-div', 'div');
+ isTabbable("#visibleAncestor-spanWithTabindex", 'span with tabindex');
+ isNotTabbable("#visibleAncestor-divWithNegativeTabindex", 'div with tabindex');
+});
+
+test("tabbable - disabled elements", function() {
+ expect(9);
+
+ isNotTabbable('#disabledElement-inputTypeNone', 'input, no type');
+ isNotTabbable('#disabledElement-inputTypeText', 'input, type text');
+ isNotTabbable('#disabledElement-inputTypeCheckbox', 'input, type checkbox');
+ isNotTabbable('#disabledElement-inputTypeRadio', 'input, type radio');
+ isNotTabbable('#disabledElement-inputTypeButton', 'input, type button');
+ isNotTabbable('#disabledElement-inputTypeHidden', 'input, type hidden');
+ isNotTabbable('#disabledElement-button', 'button');
+ isNotTabbable('#disabledElement-select', 'select');
+ isNotTabbable('#disabledElement-textarea', 'textarea');
+});
+
+test("tabbable - hidden styles", function() {
+ expect(8);
+
+ isNotTabbable('#displayNoneAncestor-input', 'input, display: none parent');
+ isNotTabbable('#displayNoneAncestor-span', 'span with tabindex, display: none parent');
+
+ isNotTabbable('#visibilityHiddenAncestor-input', 'input, visibility: hidden parent');
+ isNotTabbable('#visibilityHiddenAncestor-span', 'span with tabindex, visibility: hidden parent');
+
+ isNotTabbable('#displayNone-input', 'input, display: none');
+ isNotTabbable('#visibilityHidden-input', 'input, visibility: hidden');
+
+ isNotTabbable('#displayNone-span', 'span with tabindex, display: none');
+ isNotTabbable('#visibilityHidden-span', 'span with tabindex, visibility: hidden');
+});
+
+test("tabbable - natively tabbable with various tabindex", function() {
+ expect(4);
+
+ isTabbable('#inputTabindex0', 'input, tabindex 0');
+ isTabbable('#inputTabindex10', 'input, tabindex 10');
+ isNotTabbable('#inputTabindex-1', 'input, tabindex -1');
+ isNotTabbable('#inputTabindex-50', 'input, tabindex -50');
+});
+
+test("tabbable - not natively tabbable with various tabindex", function() {
+ expect(4);
+
+ isTabbable('#spanTabindex0', 'span, tabindex 0');
+ isTabbable('#spanTabindex10', 'span, tabindex 10');
+ isNotTabbable('#spanTabindex-1', 'span, tabindex -1');
+ isNotTabbable('#spanTabindex-50', 'span, tabindex -50');
+});
+
+test("tabbable - area elements", function() {
+ isNotTabbable('#areaCoordsNoHref', 'coords but no href');
+ isTabbable('#areaCoordsHref', 'coords and href');
+ isTabbable('#areaCoordsNoSizeHref', 'coords of zero px and href');
+ isTabbable('#areaNoCoordsHref', 'href but no coords');
+ isNotTabbable('#areaNoImg', 'not associated with an image');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html
new file mode 100644
index 0000000..67d5cb2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Datepicker Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "datepicker" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Datepicker Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html
new file mode 100644
index 0000000..592db53
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Datepicker Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.datepicker" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.datepicker.js",
+ "ui/i18n/jquery.ui.datepicker-fr.js",
+ "ui/i18n/jquery.ui.datepicker-he.js",
+ "ui/i18n/jquery.ui.datepicker-zh-CN.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="datepicker_core.js"></script>
+ <script src="datepicker_defaults.js"></script>
+ <script src="datepicker_events.js"></script>
+ <script src="datepicker_methods.js"></script>
+ <script src="datepicker_options.js"></script>
+ <script src="datepicker_tickets.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("datepicker", function() { ok(true, "disabled datepicker testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Datepicker Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div><input type="text" id="inp"><input type="text" id="alt"><div id="inl"></div></div>
+<p><input type="text" id="inp2"></p>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js
new file mode 100644
index 0000000..badb837
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js
@@ -0,0 +1,449 @@
+/*
+ * datepicker_core.js
+ */
+
+function equalsDate(d1, d2, message) {
+ if (!d1 || !d2) {
+ ok(false, message + ' - missing date');
+ return;
+ }
+ d1 = new Date(d1.getFullYear(), d1.getMonth(), d1.getDate());
+ d2 = new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
+ equals(d1.toString(), d2.toString(), message);
+}
+
+function equalsDateArray(a1, a2, message) {
+ if (!a1 || !a2) {
+ ok(false, message + ' - missing dates');
+ return;
+ }
+ a1[0] = (a1[0] ? new Date(a1[0].getFullYear(), a1[0].getMonth(), a1[0].getDate()) : '');
+ a1[1] = (a1[1] ? new Date(a1[1].getFullYear(), a1[1].getMonth(), a1[1].getDate()) : '');
+ a2[0] = (a2[0] ? new Date(a2[0].getFullYear(), a2[0].getMonth(), a2[0].getDate()) : '');
+ a2[1] = (a2[1] ? new Date(a2[1].getFullYear(), a2[1].getMonth(), a2[1].getDate()) : '');
+ same(a1, a2, message);
+}
+
+function addMonths(date, offset) {
+ var maxDay = 32 - new Date(date.getFullYear(), date.getMonth() + offset, 32).getDate();
+ date.setDate(Math.min(date.getDate(), maxDay));
+ date.setMonth(date.getMonth() + offset);
+ return date;
+}
+
+function init(id, options) {
+ $.datepicker.setDefaults($.datepicker.regional['']);
+ return $(id).datepicker($.extend({showAnim: ''}, options || {}));
+}
+
+var PROP_NAME = 'datepicker';
+
+(function($) {
+
+module("datepicker: core");
+
+test( "widget method - empty collection", function() {
+ $( "#nonExist" ).datepicker(); // should create nothing
+ ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
+});
+
+test("widget method", function() {
+ var actual = $("#inp").datepicker().datepicker("widget")[0];
+ same($("body > #ui-datepicker-div:last-child")[0], actual);
+});
+
+test('baseStructure', function() {
+ var inp = init('#inp');
+ inp.focus();
+ var dp = $('#ui-datepicker-div');
+ var iframe = ($.browser.msie && parseInt($.browser.version) < 7);
+ ok(dp.is(':visible'), 'Structure - datepicker visible');
+ ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left');
+ ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month');
+ equals(dp.children().length, 2 + (iframe ? 1 : 0), 'Structure - child count');
+
+ var header = dp.children(':first');
+ ok(header.is('div.ui-datepicker-header'), 'Structure - header division');
+ equals(header.children().length, 3, 'Structure - header child count');
+ ok(header.children(':first').is('a.ui-datepicker-prev') && header.children(':first').html() != '', 'Structure - prev link');
+ ok(header.children(':eq(1)').is('a.ui-datepicker-next') && header.children(':eq(1)').html() != '', 'Structure - next link');
+
+ var title = header.children(':last');
+ ok(title.is('div.ui-datepicker-title') && title.html() != '','Structure - title division');
+ equals(title.children().length, 2, 'Structure - title child count');
+ ok(title.children(':first').is('span.ui-datepicker-month') && title.children(':first').text() != '', 'Structure - month text')
+ ok(title.children(':last').is('span.ui-datepicker-year') && title.children(':last').text() != '', 'Structure - year text')
+
+ var table = dp.children(':eq(1)');
+ ok(table.is('table.ui-datepicker-calendar'), 'Structure - month table');
+ ok(table.children(':first').is('thead'), 'Structure - month table thead');
+ var thead = table.children(':first').children(':first');
+ ok(thead.is('tr'), 'Structure - month table title row');
+ equals(thead.find('th').length, 7, 'Structure - month table title cells');
+ ok(table.children(':eq(1)').is('tbody'), 'Structure - month table body');
+ ok(table.children(':eq(1)').children('tr').length >= 4, 'Structure - month table week count');
+ var week = table.children(':eq(1)').children(':first');
+ ok(week.is('tr'), 'Structure - month table week row');
+ equals(week.children().length, 7, 'Structure - week child count');
+ ok(week.children(':first').is('td.ui-datepicker-week-end'), 'Structure - month table first day cell');
+ ok(week.children(':last').is('td.ui-datepicker-week-end'), 'Structure - month table second day cell');
+ ok(dp.children('iframe').length == (iframe ? 1 : 0), 'Structure - iframe');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Editable month/year and button panel
+ inp = init('#inp', {changeMonth: true, changeYear: true, showButtonPanel: true});
+ inp.focus();
+
+ var title = dp.find('div.ui-datepicker-title');
+ ok(title.children(':first').is('select.ui-datepicker-month'), 'Structure - month selector');
+ ok(title.children(':last').is('select.ui-datepicker-year'), 'Structure - year selector');
+
+ var panel = dp.children(':last');
+ ok(panel.is('div.ui-datepicker-buttonpane'), 'Structure - button panel division');
+ equals(panel.children().length, 2, 'Structure - button panel child count');
+ ok(panel.children(':first').is('button.ui-datepicker-current'), 'Structure - today button');
+ ok(panel.children(':last').is('button.ui-datepicker-close'), 'Structure - close button');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Multi-month 2
+ inp = init('#inp', {numberOfMonths: 2});
+ inp.focus();
+ ok(dp.is('.ui-datepicker-multi'), 'Structure multi [2] - multi-month');
+ equals(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure multi [2] - child count');
+ var child = dp.children(':first');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2] - first month division');
+ child = dp.children(':eq(1)');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2] - second month division');
+ child = dp.children(':eq(2)');
+ ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2] - row break');
+ ok(dp.is('.ui-datepicker-multi-2'), 'Structure multi [2] - multi-2');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Multi-month 3
+ inp = init('#inp', {numberOfMonths: 3});
+ inp.focus();
+ ok(dp.is('.ui-datepicker-multi-3'), 'Structure multi [3] - multi-3');
+ ok(! dp.is('.ui-datepicker-multi-2'), 'Structure multi [3] - Trac #6704');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Multi-month [2, 2]
+ inp = init('#inp', {numberOfMonths: [2, 2]});
+ inp.focus();
+ ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month');
+ equals(dp.children().length, 6 + (iframe ? 1 : 0), 'Structure multi [2,2] - child count');
+ child = dp.children(':first');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - first month division');
+ child = dp.children(':eq(1)');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2,2] - second month division');
+ child = dp.children(':eq(2)');
+ ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2,2] - row break');
+ child = dp.children(':eq(3)');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - third month division');
+ child = dp.children(':eq(4)');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2,2] - fourth month division');
+ child = dp.children(':eq(5)');
+ ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2,2] - row break');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Inline
+ var inl = init('#inl');
+ dp = inl.children();
+ ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div');
+ ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left');
+ ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month');
+ equals(dp.children().length, 2, 'Structure inline - child count');
+ var header = dp.children(':first');
+ ok(header.is('div.ui-datepicker-header'), 'Structure inline - header division');
+ equals(header.children().length, 3, 'Structure inline - header child count');
+ var table = dp.children(':eq(1)');
+ ok(table.is('table.ui-datepicker-calendar'), 'Structure inline - month table');
+ ok(table.children(':first').is('thead'), 'Structure inline - month table thead');
+ ok(table.children(':eq(1)').is('tbody'), 'Structure inline - month table body');
+ inl.datepicker('destroy');
+
+ // Inline multi-month
+ inl = init('#inl', {numberOfMonths: 2});
+ dp = inl.children();
+ ok(dp.is('.ui-datepicker-inline') && dp.is('.ui-datepicker-multi'), 'Structure inline multi - main div');
+ equals(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure inline multi - child count');
+ child = dp.children(':first');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure inline multi - first month division');
+ child = dp.children(':eq(1)');
+ ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure inline multi - second month division');
+ child = dp.children(':eq(2)');
+ ok(child.is('div.ui-datepicker-row-break'), 'Structure inline multi - row break');
+ inl.datepicker('destroy');
+});
+
+test('customStructure', function() {
+ var dp = $('#ui-datepicker-div');
+ // Check right-to-left localisation
+ var inp = init('#inp', $.datepicker.regional['he']);
+ inp.data('showButtonPanel.datepicker',true);
+ inp.focus();
+ var iframe = ($.browser.msie && parseInt($.browser.version) < 7);
+ ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left');
+ var header = dp.children(':first');
+ ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division');
+ equals(header.children().length, 3, 'Structure RTL - header child count');
+ ok(header.children(':first').is('a.ui-datepicker-next'), 'Structure RTL - prev link');
+ ok(header.children(':eq(1)').is('a.ui-datepicker-prev'), 'Structure RTL - next link');
+ var panel = dp.children(':last');
+ ok(panel.is('div.ui-datepicker-buttonpane'), 'Structure RTL - button division');
+ equals(panel.children().length, 2, 'Structure RTL - button panel child count');
+ ok(panel.children(':first').is('button.ui-datepicker-close'), 'Structure RTL - close button');
+ ok(panel.children(':last').is('button.ui-datepicker-current'), 'Structure RTL - today button');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Hide prev/next
+ inp = init('#inp', {hideIfNoPrevNext: true, minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)});
+ inp.val('02/10/2008').focus();
+ var header = dp.children(':first');
+ ok(header.is('div.ui-datepicker-header'), 'Structure hide prev/next - header division');
+ equals(header.children().length, 1, 'Structure hide prev/next - links child count');
+ ok(header.children(':first').is('div.ui-datepicker-title'), 'Structure hide prev/next - title division');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Changeable Month with read-only year
+ inp = init('#inp', {changeMonth: true});
+ inp.focus();
+ var title = dp.children(':first').children(':last');
+ equals(title.children().length, 2, 'Structure changeable month - title child count');
+ ok(title.children(':first').is('select.ui-datepicker-month'), 'Structure changeable month - month selector');
+ ok(title.children(':last').is('span.ui-datepicker-year'), 'Structure changeable month - read-only year');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Changeable year with read-only month
+ inp = init('#inp', {changeYear: true});
+ inp.focus();
+ var title = dp.children(':first').children(':last');
+ equals(title.children().length, 2, 'Structure changeable year - title child count');
+ ok(title.children(':first').is('span.ui-datepicker-month'), 'Structure changeable year - read-only month');
+ ok(title.children(':last').is('select.ui-datepicker-year'), 'Structure changeable year - year selector');
+ inp.datepicker('hide').datepicker('destroy');
+
+ // Read-only first day of week
+ inp = init('#inp', {changeFirstDay: false});
+ inp.focus();
+ var thead = dp.find('.ui-datepicker-calendar thead tr');
+ equals(thead.children().length, 7, 'Structure read-only first day - thead child count');
+ equals(thead.find('a').length, 0, 'Structure read-only first day - thead links count');
+ inp.datepicker('hide').datepicker('destroy');
+});
+
+test('keystrokes', function() {
+ var inp = init('#inp');
+ var date = new Date();
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke enter');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Keystroke enter - preset');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+home');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
+ ok(inp.datepicker('getDate') == null, 'Keystroke ctrl+end');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ ok(inp.datepicker('getDate') == null, 'Keystroke esc');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Keystroke esc - preset');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Keystroke esc - abandoned');
+ // Moving by day or week
+ inp.val('').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_LEFT}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 1);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+left');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_LEFT}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 1);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke left');
+ inp.val('').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_RIGHT}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 1);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+right');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_RIGHT}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 1);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke right');
+ inp.val('').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 7);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+up');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_UP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 7);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke up');
+ inp.val('').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 7);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+down');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_DOWN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 7);
+ equalsDate(inp.datepicker('getDate'), date, 'Keystroke down');
+ // Moving by month or year
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 4),
+ 'Keystroke pgup');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 4),
+ 'Keystroke pgdn');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 4),
+ 'Keystroke ctrl+pgup');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 4),
+ 'Keystroke ctrl+pgdn');
+ // Check for moving to short months
+ inp.val('03/31/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29),
+ 'Keystroke pgup - Feb');
+ inp.val('01/30/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29),
+ 'Keystroke pgdn - Feb');
+ inp.val('02/29/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 28),
+ 'Keystroke ctrl+pgup - Feb');
+ inp.val('02/29/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 28),
+ 'Keystroke ctrl+pgdn - Feb');
+ // Goto current
+ inp.datepicker('option', {gotoCurrent: true}).
+ datepicker('hide').val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Keystroke ctrl+home');
+ // Change steps
+ inp.datepicker('option', {stepMonths: 2, gotoCurrent: false}).
+ datepicker('hide').val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2007, 12 - 1, 4),
+ 'Keystroke pgup step 2');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 4 - 1, 4),
+ 'Keystroke pgdn step 2');
+});
+
+test('mouse', function() {
+ var inp = init('#inp');
+ var dp = $('#ui-datepicker-div');
+ var date = new Date();
+ inp.val('').datepicker('show');
+ $('.ui-datepicker-calendar tbody a:contains(10)', dp).simulate('click', {});
+ date.setDate(10);
+ equalsDate(inp.datepicker('getDate'), date, 'Mouse click');
+ inp.val('02/04/2008').datepicker('show');
+ $('.ui-datepicker-calendar tbody a:contains(12)', dp).simulate('click', {});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 12),
+ 'Mouse click - preset');
+ inp.val('02/04/2008').datepicker('show');
+ inp.val('').datepicker('show');
+ $('button.ui-datepicker-close', dp).simulate('click', {});
+ ok(inp.datepicker('getDate') == null, 'Mouse click - close');
+ inp.val('02/04/2008').datepicker('show');
+ $('button.ui-datepicker-close', dp).simulate('click', {});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Mouse click - close + preset');
+ inp.val('02/04/2008').datepicker('show');
+ $('a.ui-datepicker-prev', dp).simulate('click', {});
+ $('button.ui-datepicker-close', dp).simulate('click', {});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
+ 'Mouse click - abandoned');
+ // Current/previous/next
+ inp.val('02/04/2008').datepicker('option', {showButtonPanel: true}).datepicker('show');
+ $('.ui-datepicker-current', dp).simulate('click', {});
+ $('.ui-datepicker-calendar tbody a:contains(14)', dp).simulate('click', {});
+ date.setDate(14);
+ equalsDate(inp.datepicker('getDate'), date, 'Mouse click - current');
+ inp.val('02/04/2008').datepicker('show');
+ $('.ui-datepicker-prev', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click');
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 16),
+ 'Mouse click - previous');
+ inp.val('02/04/2008').datepicker('show');
+ $('.ui-datepicker-next', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click');
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 18),
+ 'Mouse click - next');
+ // Previous/next with minimum/maximum
+ inp.datepicker('option', {minDate: new Date(2008, 2 - 1, 2),
+ maxDate: new Date(2008, 2 - 1, 26)}).val('02/04/2008').datepicker('show');
+ $('.ui-datepicker-prev', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click');
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 16),
+ 'Mouse click - previous + min/max');
+ inp.val('02/04/2008').datepicker('show');
+ $('.ui-datepicker-next', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click');
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 18),
+ 'Mouse click - next + min/max');
+ // Inline
+ var inl = init('#inl');
+ var dp = $('.ui-datepicker-inline', inl);
+ var date = new Date();
+ inl.datepicker('setDate', date);
+ $('.ui-datepicker-calendar tbody a:contains(10)', dp).simulate('click', {});
+ date.setDate(10);
+ equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline');
+ inl.datepicker('option', {showButtonPanel: true}).datepicker('setDate', new Date(2008, 2 - 1, 4));
+ $('.ui-datepicker-calendar tbody a:contains(12)', dp).simulate('click', {});
+ equalsDate(inl.datepicker('getDate'), new Date(2008, 2 - 1, 12), 'Mouse click inline - preset');
+ inl.datepicker('option', {showButtonPanel: true});
+ $('.ui-datepicker-current', dp).simulate('click', {});
+ $('.ui-datepicker-calendar tbody a:contains(14)', dp).simulate('click', {});
+ date.setDate(14);
+ equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline - current');
+ inl.datepicker('setDate', new Date(2008, 2 - 1, 4));
+ $('.ui-datepicker-prev', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click');
+ equalsDate(inl.datepicker('getDate'), new Date(2008, 1 - 1, 16),
+ 'Mouse click inline - previous');
+ inl.datepicker('setDate', new Date(2008, 2 - 1, 4));
+ $('.ui-datepicker-next', dp).simulate('click');
+ $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click');
+ equalsDate(inl.datepicker('getDate'), new Date(2008, 3 - 1, 18),
+ 'Mouse click inline - next');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js
new file mode 100644
index 0000000..4243cf1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js
@@ -0,0 +1,9 @@
+/*
+ * datepicker_defaults.js
+ */
+
+var datepicker_defaults = {
+ disabled: false
+};
+
+//commonWidgetTests('datepicker', { defaults: datepicker_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js
new file mode 100644
index 0000000..c7c16b6
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js
@@ -0,0 +1,127 @@
+/*
+ * datepicker_events.js
+ */
+(function($) {
+
+module("datepicker: events");
+
+var selectedThis = null;
+var selectedDate = null;
+var selectedInst = null;
+
+function callback(date, inst) {
+ selectedThis = this;
+ selectedDate = date;
+ selectedInst = inst;
+}
+
+function callback2(year, month, inst) {
+ selectedThis = this;
+ selectedDate = year + '/' + month;
+ selectedInst = inst;
+}
+
+test('events', function() {
+ var inp = init('#inp', {onSelect: callback});
+ var date = new Date();
+ // onSelect
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(selectedThis, inp[0], 'Callback selected this');
+ equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback selected inst');
+ equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
+ 'Callback selected date');
+ inp.val('').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 7);
+ equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
+ 'Callback selected date - ctrl+down');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
+ 'Callback selected date - esc');
+ var dateStr = '02/04/2008';
+ inp.val(dateStr).datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(dateStr, selectedDate,
+ 'onSelect is called after enter keydown');
+ // onChangeMonthYear
+ inp.datepicker('option', {onChangeMonthYear: callback2, onSelect: null}).
+ val('').datepicker('show');
+ var newMonthYear = function(date) {
+ return date.getFullYear() + '/' + (date.getMonth() + 1);
+ };
+ date = new Date();
+ date.setDate(1);
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGUP});
+ date.setMonth(date.getMonth() - 1);
+ equals(selectedThis, inp[0], 'Callback change month/year this');
+ equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback change month/year inst');
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year date - pgup');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
+ date.setMonth(date.getMonth() + 1);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year date - pgdn');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP});
+ date.setFullYear(date.getFullYear() - 1);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year date - ctrl+pgup');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME});
+ date.setFullYear(date.getFullYear() + 1);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year date - ctrl+home');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN});
+ date.setFullYear(date.getFullYear() + 1);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year date - ctrl+pgdn');
+ inp.datepicker('setDate', new Date(2007, 1 - 1, 26));
+ equals(selectedDate, '2007/1', 'Callback change month/year date - setDate');
+ selectedDate = null;
+ inp.datepicker('setDate', new Date(2007, 1 - 1, 12));
+ ok(selectedDate == null, 'Callback change month/year date - setDate no change');
+ // onChangeMonthYear step by 2
+ inp.datepicker('option', {stepMonths: 2}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_PGUP});
+ date.setMonth(date.getMonth() - 14);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year by 2 date - pgup');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP});
+ date.setMonth(date.getMonth() - 12);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year by 2 date - ctrl+pgup');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
+ date.setMonth(date.getMonth() + 2);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year by 2 date - pgdn');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN});
+ date.setMonth(date.getMonth() + 12);
+ equals(selectedDate, newMonthYear(date),
+ 'Callback change month/year by 2 date - ctrl+pgdn');
+ // onClose
+ inp.datepicker('option', {onClose: callback, onChangeMonthYear: null, stepMonths: 1}).
+ val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equals(selectedThis, inp[0], 'Callback close this');
+ equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback close inst');
+ equals(selectedDate, '', 'Callback close date - esc');
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', new Date()),
+ 'Callback close date - enter');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equals(selectedDate, '02/04/2008', 'Callback close date - preset');
+ inp.val('02/04/2008').datepicker('show').
+ simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
+ equals(selectedDate, '', 'Callback close date - ctrl+end');
+
+ var inp2 = init('#inp2');
+ inp2.datepicker().datepicker('option', {onClose: callback}).datepicker('show');
+ inp.datepicker('show');
+ equals(selectedThis, inp2[0], 'Callback close this');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js
new file mode 100644
index 0000000..c8f1b75
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js
@@ -0,0 +1,121 @@
+/*
+ * datepicker_methods.js
+ */
+(function($) {
+
+module("datepicker: methods");
+
+test('destroy', function() {
+ var inp = init('#inp');
+ ok(inp.is('.hasDatepicker'), 'Default - marker class set');
+ ok($.data(inp[0], PROP_NAME), 'Default - instance present');
+ ok(inp.next().is('#alt'), 'Default - button absent');
+ inp.datepicker('destroy');
+ inp = $('#inp');
+ ok(!inp.is('.hasDatepicker'), 'Default - marker class cleared');
+ ok(!$.data(inp[0], PROP_NAME), 'Default - instance absent');
+ ok(inp.next().is('#alt'), 'Default - button absent');
+ // With button
+ inp= init('#inp', {showOn: 'both'});
+ ok(inp.is('.hasDatepicker'), 'Button - marker class set');
+ ok($.data(inp[0], PROP_NAME), 'Button - instance present');
+ ok(inp.next().text() == '...', 'Button - button added');
+ inp.datepicker('destroy');
+ inp = $('#inp');
+ ok(!inp.is('.hasDatepicker'), 'Button - marker class cleared');
+ ok(!$.data(inp[0], PROP_NAME), 'Button - instance absent');
+ ok(inp.next().is('#alt'), 'Button - button removed');
+ // With append text
+ inp = init('#inp', {appendText: 'Testing'});
+ ok(inp.is('.hasDatepicker'), 'Append - marker class set');
+ ok($.data(inp[0], PROP_NAME), 'Append - instance present');
+ ok(inp.next().text() == 'Testing', 'Append - append text added');
+ inp.datepicker('destroy');
+ inp = $('#inp');
+ ok(!inp.is('.hasDatepicker'), 'Append - marker class cleared');
+ ok(!$.data(inp[0], PROP_NAME), 'Append - instance absent');
+ ok(inp.next().is('#alt'), 'Append - append text removed');
+ // With both
+ inp= init('#inp', {showOn: 'both', buttonImageOnly: true,
+ buttonImage: 'img/calendar.gif', appendText: 'Testing'});
+ ok(inp.is('.hasDatepicker'), 'Both - marker class set');
+ ok($.data(inp[0], PROP_NAME), 'Both - instance present');
+ ok(inp.next()[0].nodeName.toLowerCase() == 'img', 'Both - button added');
+ ok(inp.next().next().text() == 'Testing', 'Both - append text added');
+ inp.datepicker('destroy');
+ inp = $('#inp');
+ ok(!inp.is('.hasDatepicker'), 'Both - marker class cleared');
+ ok(!$.data(inp[0], PROP_NAME), 'Both - instance absent');
+ ok(inp.next().is('#alt'), 'Both - button and append text absent');
+ // Inline
+ var inl = init('#inl');
+ ok(inl.is('.hasDatepicker'), 'Inline - marker class set');
+ ok(inl.html() != '', 'Inline - datepicker present');
+ ok($.data(inl[0], PROP_NAME), 'Inline - instance present');
+ ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent');
+ inl.datepicker('destroy');
+ inl = $('#inl');
+ ok(!inl.is('.hasDatepicker'), 'Inline - marker class cleared');
+ ok(inl.html() == '', 'Inline - datepicker absent');
+ ok(!$.data(inl[0], PROP_NAME), 'Inline - instance absent');
+ ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent');
+});
+
+test('enableDisable', function() {
+ var inp = init('#inp');
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable - field initially enabled');
+ inp.datepicker('disable');
+ ok(inp.datepicker('isDisabled'), 'Enable/disable - now marked as disabled');
+ ok(inp[0].disabled, 'Enable/disable - field now disabled');
+ inp.datepicker('enable');
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable - now marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable - field now enabled');
+ inp.datepicker('destroy');
+ // With a button
+ inp = init('#inp', {showOn: 'button'});
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable button - initially marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable button - field initially enabled');
+ ok(!inp.next('button')[0].disabled, 'Enable/disable button - button initially enabled');
+ inp.datepicker('disable');
+ ok(inp.datepicker('isDisabled'), 'Enable/disable button - now marked as disabled');
+ ok(inp[0].disabled, 'Enable/disable button - field now disabled');
+ ok(inp.next('button')[0].disabled, 'Enable/disable button - button now disabled');
+ inp.datepicker('enable');
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable button - now marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable button - field now enabled');
+ ok(!inp.next('button')[0].disabled, 'Enable/disable button - button now enabled');
+ inp.datepicker('destroy');
+ // With an image button
+ inp = init('#inp', {showOn: 'button', buttonImageOnly: true,
+ buttonImage: 'img/calendar.gif'});
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable image - initially marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable image - field initially enabled');
+ ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image initially enabled');
+ inp.datepicker('disable');
+ ok(inp.datepicker('isDisabled'), 'Enable/disable image - now marked as disabled');
+ ok(inp[0].disabled, 'Enable/disable image - field now disabled');
+ ok(inp.next('img').css('opacity') != 1, 'Enable/disable image - image now disabled');
+ inp.datepicker('enable');
+ ok(!inp.datepicker('isDisabled'), 'Enable/disable image - now marked as enabled');
+ ok(!inp[0].disabled, 'Enable/disable image - field now enabled');
+ ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled');
+ inp.datepicker('destroy');
+ // Inline
+ var inl = init('#inl', {changeYear: true});
+ var dp = $('.ui-datepicker-inline', inl);
+ ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled');
+ ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visually disabled initially');
+ ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled initially');
+ inl.datepicker('disable');
+ ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled');
+ ok(dp.children().is('.ui-state-disabled'), 'Enable/disable inline - visually disabled');
+ ok(dp.find('select').prop('disabled'), 'Enable/disable inline - form element disabled');
+ inl.datepicker('enable');
+ ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled');
+ ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visiually disabled');
+ ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled');
+ inl.datepicker('destroy');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js
new file mode 100644
index 0000000..272af9d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js
@@ -0,0 +1,925 @@
+/*
+ * datepicker_options.js
+ */
+
+(function($) {
+
+module("datepicker: options");
+
+test('setDefaults', function() {
+ var inp = init('#inp');
+ equals($.datepicker._defaults.showOn, 'focus', 'Initial showOn');
+ $.datepicker.setDefaults({showOn: 'button'});
+ equals($.datepicker._defaults.showOn, 'button', 'Change default showOn');
+ $.datepicker.setDefaults({showOn: 'focus'});
+ equals($.datepicker._defaults.showOn, 'focus', 'Restore showOn');
+});
+
+test('option', function() {
+ var inp = init('#inp');
+ var inst = $.data(inp[0], PROP_NAME);
+ // Set option
+ equals(inst.settings.showOn, null, 'Initial setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn');
+ inp.datepicker('option', 'showOn', 'button');
+ equals(inst.settings.showOn, 'button', 'Change setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+ inp.datepicker('option', {showOn: 'both'});
+ equals(inst.settings.showOn, 'both', 'Change setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+ inp.datepicker('option', 'showOn', undefined);
+ equals(inst.settings.showOn, null, 'Clear setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+ // Get option
+ inp = init('#inp');
+ equals(inp.datepicker('option', 'showOn'), 'focus', 'Initial setting showOn');
+ inp.datepicker('option', 'showOn', 'button');
+ equals(inp.datepicker('option', 'showOn'), 'button', 'Change instance showOn');
+ inp.datepicker('option', 'showOn', undefined);
+ equals(inp.datepicker('option', 'showOn'), 'focus', 'Reset instance showOn');
+ same(inp.datepicker('option', 'all'), {showAnim: ''}, 'Get instance settings');
+ same(inp.datepicker('option', 'defaults'), $.datepicker._defaults,
+ 'Get default settings');
+});
+
+test('change', function() {
+ var inp = init('#inp');
+ var inst = $.data(inp[0], PROP_NAME);
+ equals(inst.settings.showOn, null, 'Initial setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn');
+ inp.datepicker('change', 'showOn', 'button');
+ equals(inst.settings.showOn, 'button', 'Change setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+ inp.datepicker('change', {showOn: 'both'});
+ equals(inst.settings.showOn, 'both', 'Change setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+ inp.datepicker('change', 'showOn', undefined);
+ equals(inst.settings.showOn, null, 'Clear setting showOn');
+ equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn');
+ equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
+});
+
+test('invocation', function() {
+ var inp = init('#inp');
+ var dp = $('#ui-datepicker-div');
+ var body = $('body');
+ // On focus
+ var button = inp.siblings('button');
+ ok(button.length == 0, 'Focus - button absent');
+ var image = inp.siblings('img');
+ ok(image.length == 0, 'Focus - image absent');
+ inp.focus();
+ ok(dp.is(':visible'), 'Focus - rendered on focus');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ ok(!dp.is(':visible'), 'Focus - hidden on exit');
+ inp.focus();
+ ok(dp.is(':visible'), 'Focus - rendered on focus');
+ body.simulate('mousedown', {});
+ ok(!dp.is(':visible'), 'Focus - hidden on external click');
+ inp.datepicker('hide').datepicker('destroy');
+ // On button
+ inp = init('#inp', {showOn: 'button', buttonText: 'Popup'});
+ ok(!dp.is(':visible'), 'Button - initially hidden');
+ button = inp.siblings('button');
+ image = inp.siblings('img');
+ ok(button.length == 1, 'Button - button present');
+ ok(image.length == 0, 'Button - image absent');
+ equals(button.text(), 'Popup', 'Button - button text');
+ inp.focus();
+ ok(!dp.is(':visible'), 'Button - not rendered on focus');
+ button.click();
+ ok(dp.is(':visible'), 'Button - rendered on button click');
+ button.click();
+ ok(!dp.is(':visible'), 'Button - hidden on second button click');
+ inp.datepicker('hide').datepicker('destroy');
+ // On image button
+ inp = init('#inp', {showOn: 'button', buttonImageOnly: true,
+ buttonImage: 'img/calendar.gif', buttonText: 'Cal'});
+ ok(!dp.is(':visible'), 'Image button - initially hidden');
+ button = inp.siblings('button');
+ ok(button.length == 0, 'Image button - button absent');
+ image = inp.siblings('img');
+ ok(image.length == 1, 'Image button - image present');
+ equals(image.attr('src'), 'img/calendar.gif', 'Image button - image source');
+ equals(image.attr('title'), 'Cal', 'Image button - image text');
+ inp.focus();
+ ok(!dp.is(':visible'), 'Image button - not rendered on focus');
+ image.click();
+ ok(dp.is(':visible'), 'Image button - rendered on image click');
+ image.click();
+ ok(!dp.is(':visible'), 'Image button - hidden on second image click');
+ inp.datepicker('hide').datepicker('destroy');
+ // On both
+ inp = init('#inp', {showOn: 'both', buttonImage: 'img/calendar.gif'});
+ ok(!dp.is(':visible'), 'Both - initially hidden');
+ button = inp.siblings('button');
+ ok(button.length == 1, 'Both - button present');
+ image = inp.siblings('img');
+ ok(image.length == 0, 'Both - image absent');
+ image = button.children('img');
+ ok(image.length == 1, 'Both - button image present');
+ inp.focus();
+ ok(dp.is(':visible'), 'Both - rendered on focus');
+ body.simulate('mousedown', {});
+ ok(!dp.is(':visible'), 'Both - hidden on external click');
+ button.click();
+ ok(dp.is(':visible'), 'Both - rendered on button click');
+ button.click();
+ ok(!dp.is(':visible'), 'Both - hidden on second button click');
+ inp.datepicker('hide').datepicker('destroy');
+});
+
+test('otherMonths', function() {
+ var inp = init('#inp');
+ var pop = $('#ui-datepicker-div');
+ inp.val('06/01/2009').datepicker('show');
+ equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
+ 'Other months - none');
+ ok(pop.find('td:last *').length == 0, 'Other months - no content');
+ inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show');
+ equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234',
+ 'Other months - show');
+ ok(pop.find('td:last span').length == 1, 'Other months - span content');
+ inp.datepicker('hide').datepicker('option', 'selectOtherMonths', true).datepicker('show');
+ equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234',
+ 'Other months - select');
+ ok(pop.find('td:last a').length == 1, 'Other months - link content');
+ inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show');
+ equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
+ 'Other months - none');
+ ok(pop.find('td:last *').length == 0, 'Other months - no content');
+});
+
+test('defaultDate', function() {
+ var inp = init('#inp');
+ var date = new Date();
+ inp.val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date, 'Default date null');
+ // Numeric values
+ inp.datepicker('option', {defaultDate: -2}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 2);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date -2');
+ inp.datepicker('option', {defaultDate: 3}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 5);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date 3');
+ inp.datepicker('option', {defaultDate: 1 / 0}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 3);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date Infinity');
+ inp.datepicker('option', {defaultDate: 1 / 'a'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date, 'Default date NaN');
+ // String offset values
+ inp.datepicker('option', {defaultDate: '-1d'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() - 1);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date -1d');
+ inp.datepicker('option', {defaultDate: '+3D'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 4);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date +3D');
+ inp.datepicker('option', {defaultDate: ' -2 w '}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = new Date();
+ date.setDate(date.getDate() - 14);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date -2 w');
+ inp.datepicker('option', {defaultDate: '+1 W'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setDate(date.getDate() + 21);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date +1 W');
+ inp.datepicker('option', {defaultDate: ' -1 m '}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = addMonths(new Date(), -1);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date -1 m');
+ inp.datepicker('option', {defaultDate: '+2M'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = addMonths(new Date(), 2);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date +2M');
+ inp.datepicker('option', {defaultDate: '-2y'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = new Date();
+ date.setFullYear(date.getFullYear() - 2);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date -2y');
+ inp.datepicker('option', {defaultDate: '+1 Y '}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date.setFullYear(date.getFullYear() + 3);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date +1 Y');
+ inp.datepicker('option', {defaultDate: '+1M +10d'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = addMonths(new Date(), 1);
+ date.setDate(date.getDate() + 10);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date +1M +10d');
+ // String date values
+ inp.datepicker('option', {defaultDate: '07/04/2007'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = new Date(2007, 7 - 1, 4);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date 07/04/2007');
+ inp.datepicker('option', {dateFormat: 'yy-mm-dd', defaultDate: '2007-04-02'}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ date = new Date(2007, 4 - 1, 2);
+ equalsDate(inp.datepicker('getDate'), date, 'Default date 2007-04-02');
+ // Date value
+ date = new Date(2007, 1 - 1, 26);
+ inp.datepicker('option', {dateFormat: 'mm/dd/yy', defaultDate: date}).
+ datepicker('hide').val('').datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date, 'Default date 01/26/2007');
+});
+
+test('miscellaneous', function() {
+ var dp = $('#ui-datepicker-div');
+ var inp = init('#inp');
+ // Year range
+ var genRange = function(start, offset) {
+ var range = '';
+ for (var i = start; i < start + offset; i++) {
+ range += i;
+ }
+ return range;
+ };
+ var curYear = new Date().getFullYear();
+ inp.val('02/04/2008').datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), '2008', 'Year range - read-only default');
+ inp.datepicker('hide').datepicker('option', {changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 10, 21), 'Year range - changeable default');
+ inp.datepicker('hide').datepicker('option', {yearRange: 'c-6:c+2', changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6, 9), 'Year range - c-6:c+2');
+ inp.datepicker('hide').datepicker('option', {yearRange: '2000:2010', changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2000, 11), 'Year range - 2000:2010');
+ inp.datepicker('hide').datepicker('option', {yearRange: '-5:+3', changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(curYear - 5, 9), 'Year range - -5:+3');
+ inp.datepicker('hide').datepicker('option', {yearRange: '2000:-5', changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2000, curYear - 2004), 'Year range - 2000:-5');
+ inp.datepicker('hide').datepicker('option', {yearRange: '', changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(curYear, 1), 'Year range - -6:+2');
+
+ // Navigation as date format
+ inp.datepicker('option', {showButtonPanel: true});
+ equals(dp.find('.ui-datepicker-prev').text(), 'Prev', 'Navigation prev - default');
+ equals(dp.find('.ui-datepicker-current').text(), 'Today', 'Navigation current - default');
+ equals(dp.find('.ui-datepicker-next').text(), 'Next', 'Navigation next - default');
+ inp.datepicker('hide').datepicker('option', {navigationAsDateFormat: true, prevText: '< M', currentText: 'MM', nextText: 'M >'}).
+ val('02/04/2008').datepicker('show');
+ var longNames = $.datepicker.regional[''].monthNames;
+ var shortNames = $.datepicker.regional[''].monthNamesShort;
+ var date = new Date();
+ equals(dp.find('.ui-datepicker-prev').text(), '< ' + shortNames[0], 'Navigation prev - as date format');
+ equals(dp.find('.ui-datepicker-current').text(),
+ longNames[date.getMonth()], 'Navigation current - as date format');
+ equals(dp.find('.ui-datepicker-next').text(),
+ shortNames[2] + ' >', 'Navigation next - as date format');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
+ equals(dp.find('.ui-datepicker-prev').text(),
+ '< ' + shortNames[1], 'Navigation prev - as date format + pgdn');
+ equals(dp.find('.ui-datepicker-current').text(),
+ longNames[date.getMonth()], 'Navigation current - as date format + pgdn');
+ equals(dp.find('.ui-datepicker-next').text(),
+ shortNames[3] + ' >', 'Navigation next - as date format + pgdn');
+ inp.datepicker('hide').datepicker('option', {gotoCurrent: true}).
+ val('02/04/2008').datepicker('show');
+ equals(dp.find('.ui-datepicker-prev').text(),
+ '< ' + shortNames[0], 'Navigation prev - as date format + goto current');
+ equals(dp.find('.ui-datepicker-current').text(),
+ longNames[1], 'Navigation current - as date format + goto current');
+ equals(dp.find('.ui-datepicker-next').text(),
+ shortNames[2] + ' >', 'Navigation next - as date format + goto current');
+});
+
+test('minMax', function() {
+ var inp = init('#inp');
+ var lastYear = new Date(2007, 6 - 1, 4);
+ var nextYear = new Date(2009, 6 - 1, 4);
+ var minDate = new Date(2008, 2 - 1, 29);
+ var maxDate = new Date(2008, 12 - 1, 7);
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), lastYear,
+ 'Min/max - null, null - ctrl+pgup');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), nextYear,
+ 'Min/max - null, null - ctrl+pgdn');
+ inp.datepicker('option', {minDate: minDate}).
+ datepicker('hide').val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), minDate,
+ 'Min/max - 02/29/2008, null - ctrl+pgup');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), nextYear,
+ 'Min/max - 02/29/2008, null - ctrl+pgdn');
+ inp.datepicker('option', {maxDate: maxDate}).
+ datepicker('hide').val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), minDate,
+ 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgup');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), maxDate,
+ 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgdn');
+ inp.datepicker('option', {minDate: null}).
+ datepicker('hide').val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), lastYear,
+ 'Min/max - null, 12/07/2008 - ctrl+pgup');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), maxDate,
+ 'Min/max - null, 12/07/2008 - ctrl+pgdn');
+ // Relative dates
+ var date = new Date();
+ date.setDate(date.getDate() - 7);
+ inp.datepicker('option', {minDate: '-1w', maxDate: '+1 M +10 D '}).
+ datepicker('hide').val('').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date,
+ 'Min/max - -1w, +1 M +10 D - ctrl+pgup');
+ date = addMonths(new Date(), 1);
+ date.setDate(date.getDate() + 10);
+ inp.val('').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equalsDate(inp.datepicker('getDate'), date,
+ 'Min/max - -1w, +1 M +10 D - ctrl+pgdn');
+ // With existing date
+ inp = init('#inp');
+ inp.val('06/04/2008').datepicker('option', {minDate: minDate});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate > min');
+ inp.datepicker('option', {minDate: null}).val('01/04/2008').datepicker('option', {minDate: minDate});
+ equalsDate(inp.datepicker('getDate'), minDate, 'Min/max - setDate < min');
+ inp.datepicker('option', {minDate: null}).val('06/04/2008').datepicker('option', {maxDate: maxDate});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate < max');
+ inp.datepicker('option', {maxDate: null}).val('01/04/2009').datepicker('option', {maxDate: maxDate});
+ equalsDate(inp.datepicker('getDate'), maxDate, 'Min/max - setDate > max');
+ inp.datepicker('option', {maxDate: null}).val('01/04/2008').datepicker('option', {minDate: minDate, maxDate: maxDate});
+ equalsDate(inp.datepicker('getDate'), minDate, 'Min/max - setDate < min');
+ inp.datepicker('option', {maxDate: null}).val('06/04/2008').datepicker('option', {minDate: minDate, maxDate: maxDate});
+ equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate > min, < max');
+ inp.datepicker('option', {maxDate: null}).val('01/04/2009').datepicker('option', {minDate: minDate, maxDate: maxDate});
+ equalsDate(inp.datepicker('getDate'), maxDate, 'Min/max - setDate > max');
+});
+
+test('setDate', function() {
+ var inp = init('#inp');
+ var date1 = new Date(2008, 6 - 1, 4);
+ var date2 = new Date();
+ ok(inp.datepicker('getDate') == null, 'Set date - default');
+ inp.datepicker('setDate', date1);
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - 2008-06-04');
+ date1 = new Date();
+ date1.setDate(date1.getDate() + 7);
+ inp.datepicker('setDate', +7);
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - +7');
+ date2.setFullYear(date2.getFullYear() + 2);
+ inp.datepicker('setDate', '+2y');
+ equalsDate(inp.datepicker('getDate'), date2, 'Set date - +2y');
+ inp.datepicker('setDate', date1, date2);
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - two dates');
+ inp.datepicker('setDate');
+ ok(inp.datepicker('getDate') == null, 'Set date - null');
+ // Relative to current date
+ date1 = new Date();
+ date1.setDate(date1.getDate() + 7);
+ inp.datepicker('setDate', 'c +7');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c +7');
+ date1.setDate(date1.getDate() + 7);
+ inp.datepicker('setDate', 'c+7');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c+7');
+ date1.setDate(date1.getDate() - 21);
+ inp.datepicker('setDate', 'c -3 w');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c -3 w');
+ // Inline
+ var inl = init('#inl');
+ date1 = new Date(2008, 6 - 1, 4);
+ date2 = new Date();
+ equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - default');
+ inl.datepicker('setDate', date1);
+ equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - 2008-06-04');
+ date1 = new Date();
+ date1.setDate(date1.getDate() + 7);
+ inl.datepicker('setDate', +7);
+ equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - +7');
+ date2.setFullYear(date2.getFullYear() + 2);
+ inl.datepicker('setDate', '+2y');
+ equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - +2y');
+ inl.datepicker('setDate', date1, date2);
+ equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - two dates');
+ inl.datepicker('setDate');
+ ok(inl.datepicker('getDate') == null, 'Set date inline - null');
+ // Alternate field
+ var alt = $('#alt');
+ inp.datepicker('option', {altField: '#alt', altFormat: 'yy-mm-dd'});
+ date1 = new Date(2008, 6 - 1, 4);
+ inp.datepicker('setDate', date1);
+ equals(inp.val(), '06/04/2008', 'Set date alternate - 06/04/2008');
+ equals(alt.val(), '2008-06-04', 'Set date alternate - 2008-06-04');
+ // With minimum/maximum
+ inp = init('#inp');
+ date1 = new Date(2008, 1 - 1, 4);
+ date2 = new Date(2008, 6 - 1, 4);
+ var minDate = new Date(2008, 2 - 1, 29);
+ var maxDate = new Date(2008, 3 - 1, 28);
+ inp.val('').datepicker('option', {minDate: minDate}).datepicker('setDate', date2);
+ equalsDate(inp.datepicker('getDate'), date2, 'Set date min/max - setDate > min');
+ inp.datepicker('setDate', date1);
+ equalsDate(inp.datepicker('getDate'), minDate, 'Set date min/max - setDate < min');
+ inp.val('').datepicker('option', {maxDate: maxDate, minDate: null}).datepicker('setDate', date1);
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date min/max - setDate < max');
+ inp.datepicker('setDate', date2);
+ equalsDate(inp.datepicker('getDate'), maxDate, 'Set date min/max - setDate > max');
+ inp.val('').datepicker('option', {minDate: minDate}).datepicker('setDate', date1);
+ equalsDate(inp.datepicker('getDate'), minDate, 'Set date min/max - setDate < min');
+ inp.datepicker('setDate', date2);
+ equalsDate(inp.datepicker('getDate'), maxDate, 'Set date min/max - setDate > max');
+ var dateAndTimeToSet = new Date(2008, 3 - 1, 28, 1, 11, 0);
+ var dateAndTimeClone = new Date(2008, 3 - 1, 28, 1, 11, 0);
+ inp.datepicker('setDate', dateAndTimeToSet);
+ equals(dateAndTimeToSet.getTime(), dateAndTimeClone.getTime(), 'Date object passed should not be changed by setDate');
+});
+
+test('altField', function() {
+ var inp = init('#inp');
+ var alt = $('#alt');
+ // No alternate field set
+ alt.val('');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(inp.val(), '06/04/2008', 'Alt field - dp - enter');
+ equals(alt.val(), '', 'Alt field - alt not set');
+ // Alternate field set
+ alt.val('');
+ inp.datepicker('option', {altField: '#alt', altFormat: 'yy-mm-dd'}).
+ val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(inp.val(), '06/04/2008', 'Alt field - dp - enter');
+ equals(alt.val(), '2008-06-04', 'Alt field - alt - enter');
+ // Move from initial date
+ alt.val('');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(inp.val(), '07/04/2008', 'Alt field - dp - pgdn');
+ equals(alt.val(), '2008-07-04', 'Alt field - alt - pgdn');
+ // Alternate field set - closed
+ alt.val('');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
+ simulate('keydown', {keyCode: $.simulate.VK_ESC});
+ equals(inp.val(), '06/04/2008', 'Alt field - dp - pgdn/esc');
+ equals(alt.val(), '', 'Alt field - alt - pgdn/esc');
+ // Clear date and alternate
+ alt.val('');
+ inp.val('06/04/2008').datepicker('show');
+ inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
+ equals(inp.val(), '', 'Alt field - dp - ctrl+end');
+ equals(alt.val(), '', 'Alt field - alt - ctrl+end');
+
+ return
+ // TODO manual entry impl works (see altField demo) but this test doesn't
+ // probably something the rewrite won't cover anymore anyway
+
+ // Verify alt field is updated on keyup
+ alt.val('');
+ inp.val('06/04/200').datepicker('show');
+ inp.simulate('keydown', {charCode: '8'.charCodeAt(0)});
+ inp.simulate('keypress', {charCode: '8'.charCodeAt(0)});
+ inp.simulate('keyup', {charCode: '8'.charCodeAt(0)});
+ equals(inp.val(), '06/04/2008', 'Alt field - dp - manual entry');
+ equals(alt.val(), '2008-06-04', 'Alt field - manual entry');
+ // Verify alt field is not updated on keyup if date is invalid
+ inp.val('12/04');
+ inp.simulate('keydown', {charCode: '/'.charCodeAt(0)});
+ inp.simulate('keypress', {charCode: '/'.charCodeAt(0)});
+ inp.simulate('keyup', {charCode: '/'.charCodeAt(0)});
+ equals(inp.val(), '12/04/', 'Alt field - dp - manual entry incomplete');
+ equals(alt.val(), '2008-06-04', 'Alt field - manual entry - not updated');
+});
+
+test('autoSize', function() {
+ var inp = init('#inp');
+ equals(inp.prop('size'), 20, 'Auto size - default');
+ inp.datepicker('option', 'autoSize', true);
+ equals(inp.prop('size'), 10, 'Auto size - mm/dd/yy');
+ inp.datepicker('option', 'dateFormat', 'm/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - m/d/yy');
+ inp.datepicker('option', 'dateFormat', 'D M d yy');
+ equals(inp.prop('size'), 15, 'Auto size - D M d yy');
+ inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
+ equals(inp.prop('size'), 29, 'Auto size - DD, MM dd, yy');
+ // French
+ inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['fr']));
+ equals(inp.prop('size'), 29, 'Auto size - fr - default');
+ inp.datepicker('option', 'autoSize', true);
+ equals(inp.prop('size'), 10, 'Auto size - fr - dd/mm/yy');
+ inp.datepicker('option', 'dateFormat', 'm/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - fr - m/d/yy');
+ inp.datepicker('option', 'dateFormat', 'D M d yy');
+ equals(inp.prop('size'), 18, 'Auto size - fr - D M d yy');
+ inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
+ equals(inp.prop('size'), 28, 'Auto size - fr - DD, MM dd, yy');
+ // Hebrew
+ inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['he']));
+ equals(inp.prop('size'), 28, 'Auto size - he - default');
+ inp.datepicker('option', 'autoSize', true);
+ equals(inp.prop('size'), 10, 'Auto size - he - dd/mm/yy');
+ inp.datepicker('option', 'dateFormat', 'm/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - he - m/d/yy');
+ inp.datepicker('option', 'dateFormat', 'D M d yy');
+ equals(inp.prop('size'), 14, 'Auto size - he - D M d yy');
+ inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
+ equals(inp.prop('size'), 23, 'Auto size - he - DD, MM dd, yy');
+});
+
+test('daylightSaving', function() {
+ var inp = init('#inp');
+ var dp = $('#ui-datepicker-div');
+ ok(true, 'Daylight saving - ' + new Date());
+ // Australia, Sydney - AM change, southern hemisphere
+ inp.val('04/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click');
+ equals(inp.val(), '04/05/2008', 'Daylight saving - Australia 04/05/2008');
+ inp.val('04/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click');
+ equals(inp.val(), '04/06/2008', 'Daylight saving - Australia 04/06/2008');
+ inp.val('04/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click');
+ equals(inp.val(), '04/07/2008', 'Daylight saving - Australia 04/07/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click');
+ equals(inp.val(), '10/04/2008', 'Daylight saving - Australia 10/04/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click');
+ equals(inp.val(), '10/05/2008', 'Daylight saving - Australia 10/05/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click');
+ equals(inp.val(), '10/06/2008', 'Daylight saving - Australia 10/06/2008');
+ // Brasil, Brasilia - midnight change, southern hemisphere
+ inp.val('02/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(20) a', dp).simulate('click');
+ equals(inp.val(), '02/16/2008', 'Daylight saving - Brasil 02/16/2008');
+ inp.val('02/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(21) a', dp).simulate('click');
+ equals(inp.val(), '02/17/2008', 'Daylight saving - Brasil 02/17/2008');
+ inp.val('02/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(22) a', dp).simulate('click');
+ equals(inp.val(), '02/18/2008', 'Daylight saving - Brasil 02/18/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(13) a', dp).simulate('click');
+ equals(inp.val(), '10/11/2008', 'Daylight saving - Brasil 10/11/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(14) a', dp).simulate('click');
+ equals(inp.val(), '10/12/2008', 'Daylight saving - Brasil 10/12/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(15) a', dp).simulate('click');
+ equals(inp.val(), '10/13/2008', 'Daylight saving - Brasil 10/13/2008');
+ // Lebanon, Beirut - midnight change, northern hemisphere
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(34) a', dp).simulate('click');
+ equals(inp.val(), '03/29/2008', 'Daylight saving - Lebanon 03/29/2008');
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(35) a', dp).simulate('click');
+ equals(inp.val(), '03/30/2008', 'Daylight saving - Lebanon 03/30/2008');
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(36) a', dp).simulate('click');
+ equals(inp.val(), '03/31/2008', 'Daylight saving - Lebanon 03/31/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(27) a', dp).simulate('click');
+ equals(inp.val(), '10/25/2008', 'Daylight saving - Lebanon 10/25/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(28) a', dp).simulate('click');
+ equals(inp.val(), '10/26/2008', 'Daylight saving - Lebanon 10/26/2008');
+ inp.val('10/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(29) a', dp).simulate('click');
+ equals(inp.val(), '10/27/2008', 'Daylight saving - Lebanon 10/27/2008');
+ // US, Eastern - AM change, northern hemisphere
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(13) a', dp).simulate('click');
+ equals(inp.val(), '03/08/2008', 'Daylight saving - US 03/08/2008');
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(14) a', dp).simulate('click');
+ equals(inp.val(), '03/09/2008', 'Daylight saving - US 03/09/2008');
+ inp.val('03/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(15) a', dp).simulate('click');
+ equals(inp.val(), '03/10/2008', 'Daylight saving - US 03/10/2008');
+ inp.val('11/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click');
+ equals(inp.val(), '11/01/2008', 'Daylight saving - US 11/01/2008');
+ inp.val('11/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click');
+ equals(inp.val(), '11/02/2008', 'Daylight saving - US 11/02/2008');
+ inp.val('11/01/2008').datepicker('show');
+ $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click');
+ equals(inp.val(), '11/03/2008', 'Daylight saving - US 11/03/2008');
+});
+
+var beforeShowThis = null;
+var beforeShowInput = null;
+var beforeShowInst = null;
+
+function beforeAll(input, inst) {
+ beforeShowThis = this;
+ beforeShowInput = input;
+ beforeShowInst = inst;
+ return {currentText: 'Current'};
+}
+
+var beforeShowDayThis = null;
+var beforeShowDayOK = true;
+
+function beforeDay(date) {
+ beforeShowDayThis = this;
+ beforeShowDayOK &= (date > new Date(2008, 1 - 1, 26) &&
+ date < new Date(2008, 3 - 1, 6));
+ return [(date.getDate() % 2 == 0), (date.getDate() % 10 == 0 ? 'day10' : ''),
+ (date.getDate() % 3 == 0 ? 'Divisble by 3' : '')];
+}
+
+function calcWeek(date) {
+ var doy = date.getDate() + 6;
+ for (var m = date.getMonth() - 1; m >= 0; m--)
+ doy += $.datepicker._getDaysInMonth(date.getFullYear(), m);
+ // Simple count from 01/01 starting at week 1
+ return Math.floor(doy / 7);
+}
+
+test('callbacks', function() {
+ // Before show
+ var inp = init('#inp', {beforeShow: beforeAll});
+ var inst = $.data(inp[0], 'datepicker');
+ equals($.datepicker._get(inst, 'currentText'), 'Today', 'Before show - initial');
+ inp.val('02/04/2008').datepicker('show');
+ equals($.datepicker._get(inst, 'currentText'), 'Current', 'Before show - changed');
+ ok(beforeShowThis.id == inp[0].id, 'Before show - this OK');
+ ok(beforeShowInput.id == inp[0].id, 'Before show - input OK');
+ deepEqual(beforeShowInst, inst, 'Before show - inst OK');
+ inp.datepicker('hide').datepicker('destroy');
+ // Before show day
+ inp = init('#inp', {beforeShowDay: beforeDay});
+ var dp = $('#ui-datepicker-div');
+ inp.val('02/04/2008').datepicker('show');
+ ok(beforeShowDayThis.id == inp[0].id, 'Before show day - this OK');
+ ok(beforeShowDayOK, 'Before show day - dates OK');
+ var day20 = dp.find('.ui-datepicker-calendar td:contains("20")');
+ var day21 = dp.find('.ui-datepicker-calendar td:contains("21")');
+ ok(!day20.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 20');
+ ok(day21.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 21');
+ ok(day20.is('.day10'), 'Before show day - CSS 20');
+ ok(!day21.is('.day10'), 'Before show day - CSS 21');
+ ok(!day20.attr('title'), 'Before show day - title 20');
+ ok(day21.attr('title') == 'Divisble by 3', 'Before show day - title 21');
+ inp.datepicker('hide').datepicker('destroy');
+});
+
+test('localisation', function() {
+ var inp = init('#inp', $.datepicker.regional['fr']);
+ inp.datepicker('option', {dateFormat: 'DD, d MM yy', showButtonPanel:true, changeMonth:true, changeYear:true}).val('').datepicker('show');
+ var dp = $('#ui-datepicker-div');
+ equals($('.ui-datepicker-close', dp).text(), 'Fermer', 'Localisation - close');
+ $('.ui-datepicker-close', dp).simulate('mouseover');
+ equals($('.ui-datepicker-prev', dp).text(), 'Précédent', 'Localisation - previous');
+ equals($('.ui-datepicker-current', dp).text(), 'Aujourd\'hui', 'Localisation - current');
+ equals($('.ui-datepicker-next', dp).text(), 'Suivant', 'Localisation - next');
+ var month = 0;
+ $('.ui-datepicker-month option', dp).each(function() {
+ equals($(this).text(), $.datepicker.regional['fr'].monthNamesShort[month],
+ 'Localisation - month ' + month);
+ month++;
+ });
+ var day = 1;
+ $('.ui-datepicker-calendar th', dp).each(function() {
+ equals($(this).text(), $.datepicker.regional['fr'].dayNamesMin[day],
+ 'Localisation - day ' + day);
+ day = (day + 1) % 7;
+ });
+ inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ var date = new Date();
+ equals(inp.val(), $.datepicker.regional['fr'].dayNames[date.getDay()] + ', ' +
+ date.getDate() + ' ' + $.datepicker.regional['fr'].monthNames[date.getMonth()] +
+ ' ' + date.getFullYear(), 'Localisation - formatting');
+});
+
+test('noWeekends', function() {
+ for (var i = 1; i <= 31; i++) {
+ var date = new Date(2001, 1 - 1, i);
+ deepEqual($.datepicker.noWeekends(date), [(i + 1) % 7 >= 2, ''],
+ 'No weekends ' + date);
+ }
+});
+
+test('iso8601Week', function() {
+ var date = new Date(2000, 12 - 1, 31);
+ equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
+ date = new Date(2001, 1 - 1, 1);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+ date = new Date(2001, 1 - 1, 7);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+ date = new Date(2001, 1 - 1, 8);
+ equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date);
+ date = new Date(2003, 12 - 1, 28);
+ equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
+ date = new Date(2003, 12 - 1, 29);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+ date = new Date(2004, 1 - 1, 4);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+ date = new Date(2004, 1 - 1, 5);
+ equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date);
+ date = new Date(2009, 12 - 1, 28);
+ equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date);
+ date = new Date(2010, 1 - 1, 3);
+ equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date);
+ date = new Date(2010, 1 - 1, 4);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+ date = new Date(2010, 1 - 1, 10);
+ equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
+});
+
+test('parseDate', function() {
+ init('#inp');
+ ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty');
+ equalsDate($.datepicker.parseDate('d m y', '3 2 01'),
+ new Date(2001, 2 - 1, 3), 'Parse date d m y');
+ equalsDate($.datepicker.parseDate('dd mm yy', '03 02 2001'),
+ new Date(2001, 2 - 1, 3), 'Parse date dd mm yy');
+ equalsDate($.datepicker.parseDate('d m y', '13 12 01'),
+ new Date(2001, 12 - 1, 13), 'Parse date d m y');
+ equalsDate($.datepicker.parseDate('dd mm yy', '13 12 2001'),
+ new Date(2001, 12 - 1, 13), 'Parse date dd mm yy');
+ equalsDate($.datepicker.parseDate('y-o', '01-34'),
+ new Date(2001, 2 - 1, 3), 'Parse date y-o');
+ equalsDate($.datepicker.parseDate('yy-oo', '2001-347'),
+ new Date(2001, 12 - 1, 13), 'Parse date yy-oo');
+ equalsDate($.datepicker.parseDate('oo yy', '348 2004'),
+ new Date(2004, 12 - 1, 13), 'Parse date oo yy');
+ equalsDate($.datepicker.parseDate('D d M y', 'Sat 3 Feb 01'),
+ new Date(2001, 2 - 1, 3), 'Parse date D d M y');
+ equalsDate($.datepicker.parseDate('d MM DD yy', '3 February Saturday 2001'),
+ new Date(2001, 2 - 1, 3), 'Parse date dd MM DD yy');
+ equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Saturday, February 3, 2001'),
+ new Date(2001, 2 - 1, 3), 'Parse date DD, MM d, yy');
+ equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
+ 'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3),
+ 'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy');
+ var currentYear = new Date().getFullYear();
+ equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000) + '-02-03'),
+ new Date(currentYear, 2 - 1, 3), 'Parse date y-m-d - default cutuff');
+ equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 10) + '-02-03'),
+ new Date(currentYear+10, 2 - 1, 3), 'Parse date y-m-d - default cutuff');
+ equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 11) + '-02-03'),
+ new Date(currentYear-89, 2 - 1, 3), 'Parse date y-m-d - default cutuff');
+ equalsDate($.datepicker.parseDate('y-m-d', '80-02-03', {shortYearCutoff: 80}),
+ new Date(2080, 2 - 1, 3), 'Parse date y-m-d - cutoff 80');
+ equalsDate($.datepicker.parseDate('y-m-d', '81-02-03', {shortYearCutoff: 80}),
+ new Date(1981, 2 - 1, 3), 'Parse date y-m-d - cutoff 80');
+ equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 60) + '-02-03', {shortYearCutoff: '+60'}),
+ new Date(currentYear + 60, 2 - 1, 3), 'Parse date y-m-d - cutoff +60');
+ equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 61) + '-02-03', {shortYearCutoff: '+60'}),
+ new Date(currentYear - 39, 2 - 1, 3), 'Parse date y-m-d - cutoff +60');
+ var gmtDate = new Date(2001, 2 - 1, 3);
+ gmtDate.setMinutes(gmtDate.getMinutes() - gmtDate.getTimezoneOffset());
+ equalsDate($.datepicker.parseDate('@', '981158400000'), gmtDate, 'Parse date @');
+ equalsDate($.datepicker.parseDate('!', '631167552000000000'), gmtDate, 'Parse date !');
+ var fr = $.datepicker.regional['fr'];
+ var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
+ monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
+ equalsDate($.datepicker.parseDate('D d M y', 'Lun. 9 Avril 01', settings),
+ new Date(2001, 4 - 1, 9), 'Parse date D M y with settings');
+ equalsDate($.datepicker.parseDate('d MM DD yy', '9 Avril Lundi 2001', settings),
+ new Date(2001, 4 - 1, 9), 'Parse date d MM DD yy with settings');
+ equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Lundi, Avril 9, 2001', settings),
+ new Date(2001, 4 - 1, 9), 'Parse date DD, MM d, yy with settings');
+ equalsDate($.datepicker.parseDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy',
+ 'jour 9 de Avril (\'Lundi\'), 2001', settings), new Date(2001, 4 - 1, 9),
+ 'Parse date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings');
+
+ var zh = $.datepicker.regional['zh-CN'];
+ equalsDate($.datepicker.parseDate('yy M d', '2011 十一 22', zh),
+ new Date(2011, 11 - 1, 22), 'Parse date yy M d with zh-CN');
+});
+
+test('parseDateErrors', function() {
+ init('#inp');
+ var expectError = function(expr, value, error) {
+ try {
+ expr();
+ ok(false, 'Parsed error ' + value);
+ }
+ catch (e) {
+ equals(e, error, 'Parsed error ' + value);
+ }
+ };
+ expectError(function() { $.datepicker.parseDate(null, 'Sat 2 01'); },
+ 'Sat 2 01', 'Invalid arguments');
+ expectError(function() { $.datepicker.parseDate('d m y', null); },
+ 'null', 'Invalid arguments');
+ expectError(function() { $.datepicker.parseDate('d m y', 'Sat 2 01'); },
+ 'Sat 2 01 - d m y', 'Missing number at position 0');
+ expectError(function() { $.datepicker.parseDate('dd mm yy', 'Sat 2 01'); },
+ 'Sat 2 01 - dd mm yy', 'Missing number at position 0');
+ expectError(function() { $.datepicker.parseDate('d m y', '3 Feb 01'); },
+ '3 Feb 01 - d m y', 'Missing number at position 2');
+ expectError(function() { $.datepicker.parseDate('dd mm yy', '3 Feb 01'); },
+ '3 Feb 01 - dd mm yy', 'Missing number at position 2');
+ expectError(function() { $.datepicker.parseDate('d m y', '3 2 AD01'); },
+ '3 2 AD01 - d m y', 'Missing number at position 4');
+ expectError(function() { $.datepicker.parseDate('d m yy', '3 2 AD01'); },
+ '3 2 AD01 - dd mm yy', 'Missing number at position 4');
+ expectError(function() { $.datepicker.parseDate('y-o', '01-D01'); },
+ '2001-D01 - y-o', 'Missing number at position 3');
+ expectError(function() { $.datepicker.parseDate('yy-oo', '2001-D01'); },
+ '2001-D01 - yy-oo', 'Missing number at position 5');
+ expectError(function() { $.datepicker.parseDate('D d M y', 'D7 3 Feb 01'); },
+ 'D7 3 Feb 01 - D d M y', 'Unknown name at position 0');
+ expectError(function() { $.datepicker.parseDate('D d M y', 'Sat 3 M2 01'); },
+ 'Sat 3 M2 01 - D d M y', 'Unknown name at position 6');
+ expectError(function() { $.datepicker.parseDate('DD, MM d, yy', 'Saturday- Feb 3, 2001'); },
+ 'Saturday- Feb 3, 2001 - DD, MM d, yy', 'Unexpected literal at position 8');
+ expectError(function() { $.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
+ 'day 3 of February ("Saturday"), 2001'); },
+ 'day 3 of Mon2 ("Day7"), 2001', 'Unexpected literal at position 19');
+ expectError(function() { $.datepicker.parseDate('d m y', '29 2 01'); },
+ '29 2 01 - d m y', 'Invalid date');
+ var fr = $.datepicker.regional['fr'];
+ var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
+ monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
+ expectError(function() { $.datepicker.parseDate('D d M y', 'Mon 9 Avr 01', settings); },
+ 'Mon 9 Avr 01 - D d M y', 'Unknown name at position 0');
+ expectError(function() { $.datepicker.parseDate('D d M y', 'Lun. 9 Apr 01', settings); },
+ 'Lun. 9 Apr 01 - D d M y', 'Unknown name at position 7');
+});
+
+test('formatDate', function() {
+ init('#inp');
+ equals($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)),
+ '3 2 01', 'Format date d m y');
+ equals($.datepicker.formatDate('dd mm yy', new Date(2001, 2 - 1, 3)),
+ '03 02 2001', 'Format date dd mm yy');
+ equals($.datepicker.formatDate('d m y', new Date(2001, 12 - 1, 13)),
+ '13 12 01', 'Format date d m y');
+ equals($.datepicker.formatDate('dd mm yy', new Date(2001, 12 - 1, 13)),
+ '13 12 2001', 'Format date dd mm yy');
+ equals($.datepicker.formatDate('yy-o', new Date(2001, 2 - 1, 3)),
+ '2001-34', 'Format date yy-o');
+ equals($.datepicker.formatDate('yy-oo', new Date(2001, 2 - 1, 3)),
+ '2001-034', 'Format date yy-oo');
+ equals($.datepicker.formatDate('D M y', new Date(2001, 2 - 1, 3)),
+ 'Sat Feb 01', 'Format date D M y');
+ equals($.datepicker.formatDate('DD MM yy', new Date(2001, 2 - 1, 3)),
+ 'Saturday February 2001', 'Format date DD MM yy');
+ equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 2 - 1, 3)),
+ 'Saturday, February 3, 2001', 'Format date DD, MM d, yy');
+ equals($.datepicker.formatDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
+ new Date(2001, 2 - 1, 3)), 'day 3 of February (\'Saturday\'), 2001',
+ 'Format date \'day\' d \'of\' MM (\'\'DD\'\'), yy');
+ var gmtDate = new Date(2001, 2 - 1, 3);
+ gmtDate.setMinutes(gmtDate.getMinutes() - gmtDate.getTimezoneOffset());
+ equals($.datepicker.formatDate('@', gmtDate), '981158400000', 'Format date @');
+ equals($.datepicker.formatDate('!', gmtDate), '631167552000000000', 'Format date !');
+ var fr = $.datepicker.regional['fr'];
+ var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
+ monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
+ equals($.datepicker.formatDate('D M y', new Date(2001, 4 - 1, 9), settings),
+ 'Lun. Avril 01', 'Format date D M y with settings');
+ equals($.datepicker.formatDate('DD MM yy', new Date(2001, 4 - 1, 9), settings),
+ 'Lundi Avril 2001', 'Format date DD MM yy with settings');
+ equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 4 - 1, 9), settings),
+ 'Lundi, Avril 9, 2001', 'Format date DD, MM d, yy with settings');
+ equals($.datepicker.formatDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy',
+ new Date(2001, 4 - 1, 9), settings), 'jour 9 de Avril (\'Lundi\'), 2001',
+ 'Format date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js
new file mode 100644
index 0000000..3534266
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js
@@ -0,0 +1,84 @@
+/*
+ * datepicker_tickets.js
+ */
+(function($) {
+
+module("datepicker: tickets");
+
+// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
+test('beforeShowDay-getDate', function() {
+ var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }});
+ var dp = $('#ui-datepicker-div');
+ inp.val('01/01/2010').datepicker('show');
+ // contains non-breaking space
+ equals($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month');
+ $('a.ui-datepicker-next', dp).click();
+ $('a.ui-datepicker-next', dp).click();
+ // contains non-breaking space
+ equals($('div.ui-datepicker-title').text(), 'March 2010', 'After next clicks');
+ inp.datepicker('hide').datepicker('show');
+ $('a.ui-datepicker-prev', dp).click();
+ $('a.ui-datepicker-prev', dp).click();
+ // contains non-breaking space
+ equals($('div.ui-datepicker-title').text(), 'November 2009', 'After prev clicks');
+ inp.datepicker('hide');
+});
+
+test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
+ var inp = init('#inp',{
+ beforeShow: function(){
+ return false;
+ }
+ });
+ var dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equals(dp.css('display'), 'none',"beforeShow returns false");
+ inp.datepicker('destroy');
+
+ inp = init('#inp',{
+ beforeShow: function(){
+ }
+ });
+ dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equal(dp.css('display'), 'block',"beforeShow returns nothing");
+ inp.datepicker('hide');
+ inp.datepicker('destroy');
+
+ inp = init('#inp',{
+ beforeShow: function(){
+ return true;
+ }
+ });
+ dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equal(dp.css('display'), 'block',"beforeShow returns true");
+ inp.datepicker('hide');
+ inp.datepicker('destroy');
+});
+
+test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
+ var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
+ equals(time, "089");
+});
+
+test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
+ var date;
+ try{
+ date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
+ ok(false, "Did not properly detect an invalid date");
+ }catch(e){
+ ok("invalid date detected");
+ }
+
+ try {
+ date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm');
+ equal(date.getDate(), 18);
+ equal(date.getMonth(), 3);
+ equal(date.getFullYear(), 1988);
+ } catch(e) {
+ ok(false, "Did not properly parse date with extra text separated by whitespace");
+ }
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html
new file mode 100644
index 0000000..e0416ec
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Dialog Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "dialog" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Dialog Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html
new file mode 100644
index 0000000..94b20a2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Dialog Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../../external/jquery.bgiframe-2.1.2.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.dialog" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.position.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.draggable.js",
+ "ui/jquery.ui.resizable.js",
+ "ui/jquery.ui.dialog.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="dialog_core.js"></script>
+ <script src="dialog_defaults.js"></script>
+ <script src="dialog_events.js"></script>
+ <script src="dialog_methods.js"></script>
+ <script src="dialog_options.js"></script>
+ <script src="dialog_tickets.js"></script>
+
+ <script>
+ // disable this testsuite for testswarm only - until we fix it from freezing IE6
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("dialog", function() { ok(true, "disabled dialog testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Dialog Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js
new file mode 100644
index 0000000..2003689
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js
@@ -0,0 +1,138 @@
+/*
+ * dialog_core.js
+ */
+
+var el,
+ offsetBefore, offsetAfter,
+ heightBefore, heightAfter,
+ widthBefore, widthAfter,
+ dragged;
+
+function dlg() {
+ return el.dialog('widget');
+}
+
+function isOpen(why) {
+ ok(dlg().is(":visible"), why);
+}
+
+function isNotOpen(why) {
+ ok(!dlg().is(":visible"), why);
+}
+
+function drag(handle, dx, dy) {
+ var d = dlg();
+ offsetBefore = d.offset();
+ heightBefore = d.height();
+ widthBefore = d.width();
+ //this mouseover is to work around a limitation in resizable
+ //TODO: fix resizable so handle doesn't require mouseover in order to be used
+ $(handle, d).simulate("mouseover");
+ $(handle, d).simulate("drag", {
+ dx: dx || 0,
+ dy: dy || 0
+ });
+ dragged = { dx: dx, dy: dy };
+ offsetAfter = d.offset();
+ heightAfter = d.height();
+ widthAfter = d.width();
+}
+
+function moved(dx, dy, msg) {
+ msg = msg ? msg + "." : "";
+ var actual = { left: Math.round(offsetAfter.left), top: Math.round(offsetAfter.top) };
+ var expected = { left: Math.round(offsetBefore.left + dx), top: Math.round(offsetBefore.top + dy) };
+ same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
+}
+
+function shouldmove(why) {
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, -50);
+ moved(50, -50, why);
+}
+
+function shouldnotmove(why) {
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, -50);
+ moved(0, 0, why);
+}
+
+function resized(dw, dh, msg) {
+ msg = msg ? msg + "." : "";
+ var actual = { width: widthAfter, height: heightAfter };
+ var expected = { width: widthBefore + dw, height: heightBefore + dh };
+ same(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
+}
+
+function shouldresize(why) {
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ resized(50, 50, why);
+}
+
+function shouldnotresize(why) {
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ resized(0, 0, why);
+}
+
+function broder(el, side){
+ return parseInt(el.css('border-' + side + '-width'), 10);
+}
+
+function margin(el, side) {
+ return parseInt(el.css('margin-' + side), 10);
+}
+
+(function($) {
+
+module("dialog: core");
+
+test("title id", function() {
+ expect(3);
+
+ var titleId;
+
+ // reset the uuid so we know what values to expect
+ $.ui.dialog.uuid = 0;
+
+ el = $('<div></div>').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
+ el.remove();
+
+ el = $('<div></div>').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
+ el.remove();
+
+ el = $('<div id="foo">').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-foo', 'carried over title id');
+ el.remove();
+});
+
+test("ARIA", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+
+ equals(dlg().attr('role'), 'dialog', 'dialog role');
+
+ var labelledBy = dlg().attr('aria-labelledby');
+ ok(labelledBy.length > 0, 'has aria-labelledby attribute');
+ equals(dlg().find('.ui-dialog-title').attr('id'), labelledBy,
+ 'proper aria-labelledby attribute');
+
+ equals(dlg().find('.ui-dialog-titlebar-close').attr('role'), 'button',
+ 'close link role');
+
+ el.remove();
+});
+
+test("widget method", function() {
+ var dialog = $("<div>").appendTo("#main").dialog();
+ same(dialog.parent()[0], dialog.dialog("widget")[0]);
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js
new file mode 100644
index 0000000..9f2e4c6
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js
@@ -0,0 +1,34 @@
+commonWidgetTests( "dialog", {
+ defaults: {
+ autoOpen: true,
+ buttons: {},
+ closeOnEscape: true,
+ closeText: 'close',
+ disabled: false,
+ dialogClass: '',
+ draggable: true,
+ height: 'auto',
+ hide: null,
+ maxHeight: false,
+ maxWidth: false,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: {
+ my: 'center',
+ at: 'center',
+ of: window,
+ collision: 'fit',
+ using: $.ui.dialog.prototype.options.position.using
+ },
+ resizable: true,
+ show: null,
+ stack: true,
+ title: '',
+ width: 300,
+ zIndex: 1000,
+
+ // callbacks
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js
new file mode 100644
index 0000000..40a8575
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js
@@ -0,0 +1,254 @@
+/*
+ * dialog_events.js
+ */
+(function($) {
+
+module("dialog: events");
+
+test("open", function() {
+ expect(13);
+
+ el = $("<div></div>");
+ el.dialog({
+ open: function(ev, ui) {
+ ok(el.data("dialog")._isOpen, "interal _isOpen flag is set");
+ ok(true, 'autoOpen: true fires open callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogopen', 'event type in callback');
+ same(ui, {}, 'ui hash in callback');
+ }
+ });
+ el.remove();
+
+ el = $("<div></div>");
+ el.dialog({
+ autoOpen: false,
+ open: function(ev, ui) {
+ ok(true, '.dialog("open") fires open callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogopen', 'event type in callback');
+ same(ui, {}, 'ui hash in callback');
+ }
+ }).bind('dialogopen', function(ev, ui) {
+ ok(el.data("dialog")._isOpen, "interal _isOpen flag is set");
+ ok(true, 'dialog("open") fires open event');
+ equals(this, el[0], 'context of event');
+ same(ui, {}, 'ui hash in event');
+ });
+ el.dialog("open");
+ el.remove();
+});
+
+test("dragStart", function() {
+ expect(9);
+
+ el = $('<div></div>').dialog({
+ dragStart: function(ev, ui) {
+ ok(true, 'dragging fires dragStart callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogdragstart', 'event type in callback');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+ }
+ }).bind('dialogdragstart', function(ev, ui) {
+ ok(true, 'dragging fires dialogdragstart event');
+ equals(this, el[0], 'context of event');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("drag", function() {
+ expect(9);
+ var hasDragged = false;
+
+ el = $('<div></div>').dialog({
+ drag: function(ev, ui) {
+ if (!hasDragged) {
+ ok(true, 'dragging fires drag callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogdrag', 'event type in callback');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+
+ hasDragged = true;
+ }
+ }
+ }).one('dialogdrag', function(ev, ui) {
+ ok(true, 'dragging fires dialogdrag event');
+ equals(this, el[0], 'context of event');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("dragStop", function() {
+ expect(9);
+
+ el = $('<div></div>').dialog({
+ dragStop: function(ev, ui) {
+ ok(true, 'dragging fires dragStop callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogdragstop', 'event type in callback');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+ }
+ }).bind('dialogdragstop', function(ev, ui) {
+ ok(true, 'dragging fires dialogdragstop event');
+ equals(this, el[0], 'context of event');
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.offset !== undefined, "ui.offset in callback");
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("resizeStart", function() {
+ expect(13);
+
+ el = $('<div></div>').dialog({
+ resizeStart: function(ev, ui) {
+ ok(true, 'resizing fires resizeStart callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogresizestart', 'event type in callback');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+ }
+ }).bind('dialogresizestart', function(ev, ui) {
+ ok(true, 'resizing fires dialogresizestart event');
+ equals(this, el[0], 'context of event');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("resize", function() {
+ expect(13);
+ var hasResized = false;
+
+ el = $('<div></div>').dialog({
+ resize: function(ev, ui) {
+ if (!hasResized) {
+ ok(true, 'resizing fires resize callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogresize', 'event type in callback');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+
+ hasResized = true;
+ }
+ }
+ }).one('dialogresize', function(ev, ui) {
+ ok(true, 'resizing fires dialogresize event');
+ equals(this, el[0], 'context of event');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("resizeStop", function() {
+ expect(13);
+
+ el = $('<div></div>').dialog({
+ resizeStop: function(ev, ui) {
+ ok(true, 'resizing fires resizeStop callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogresizestop', 'event type in callback');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+ }
+ }).bind('dialogresizestop', function(ev, ui) {
+ ok(true, 'resizing fires dialogresizestop event');
+ equals(this, el[0], 'context of event');
+ ok(ui.originalPosition !== undefined, "ui.originalPosition in callback");
+ ok(ui.originalSize !== undefined, "ui.originalSize in callback");
+ ok(ui.position !== undefined, "ui.position in callback");
+ ok(ui.size !== undefined, "ui.size in callback");
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("close", function() {
+ expect(7);
+
+ el = $('<div></div>').dialog({
+ close: function(ev, ui) {
+ ok(true, '.dialog("close") fires close callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogclose', 'event type in callback');
+ same(ui, {}, 'ui hash in callback');
+ }
+ }).bind('dialogclose', function(ev, ui) {
+ ok(true, '.dialog("close") fires dialogclose event');
+ equals(this, el[0], 'context of event');
+ same(ui, {}, 'ui hash in event');
+ });
+ el.dialog('close');
+ el.remove();
+});
+
+test("beforeClose", function() {
+ expect(14);
+
+ el = $('<div></div>').dialog({
+ beforeClose: function(ev, ui) {
+ ok(true, '.dialog("close") fires beforeClose callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogbeforeclose', 'event type in callback');
+ same(ui, {}, 'ui hash in callback');
+ return false;
+ }
+ });
+ el.dialog('close');
+ isOpen('beforeClose callback should prevent dialog from closing');
+ el.remove();
+
+ el = $('<div></div>').dialog();
+ el.dialog('option', 'beforeClose', function(ev, ui) {
+ ok(true, '.dialog("close") fires beforeClose callback');
+ equals(this, el[0], "context of callback");
+ equals(ev.type, 'dialogbeforeclose', 'event type in callback');
+ same(ui, {}, 'ui hash in callback');
+ return false;
+ });
+ el.dialog('close');
+ isOpen('beforeClose callback should prevent dialog from closing');
+ el.remove();
+
+ el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) {
+ ok(true, '.dialog("close") triggers dialogbeforeclose event');
+ equals(this, el[0], "context of event");
+ same(ui, {}, 'ui hash in event');
+ return false;
+ });
+ el.dialog('close');
+ isOpen('dialogbeforeclose event should prevent dialog from closing');
+ el.remove();
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js
new file mode 100644
index 0000000..a961b4e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js
@@ -0,0 +1,127 @@
+/*
+ * dialog_methods.js
+ */
+(function($) {
+
+module("dialog: methods", {
+ teardown: function() {
+ $("body>.ui-dialog").remove();
+ }
+});
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').dialog().remove();
+ ok(true, '.dialog() called on element');
+
+ $([]).dialog().remove();
+ ok(true, '.dialog() called on empty collection');
+
+ $('<div></div>').dialog().remove();
+ ok(true, '.dialog() called on disconnected DOMElement - never connected');
+
+ $('<div></div>').appendTo('body').remove().dialog().remove();
+ ok(true, '.dialog() called on disconnected DOMElement - removed');
+
+ el = $('<div></div>').dialog();
+ var foo = el.dialog("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').dialog().dialog("option", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on element');
+
+ $([]).dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on empty collection');
+
+ $('<div></div>').dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on disconnected DOMElement');
+
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('enable');
+ equals(actual, expected, 'enable is chainable');
+
+ el = $('<div></div>').dialog({ disabled: true });
+ el.dialog('enable');
+ equals(el.dialog('option', 'disabled'), false, 'enable method sets disabled option to false');
+ ok(!dlg().hasClass('ui-dialog-disabled'), 'enable method removes ui-dialog-disabled class from ui-dialog element');
+});
+
+test("disable", function() {
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('disable');
+ equals(actual, expected, 'disable is chainable');
+
+ el = $('<div></div>').dialog({ disabled: false });
+ el.dialog('disable');
+ equals(el.dialog('option', 'disabled'), true, 'disable method sets disabled option to true');
+ ok(dlg().hasClass('ui-dialog-disabled'), 'disable method adds ui-dialog-disabled class to ui-dialog element');
+});
+
+test("close", function() {
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('close');
+ equals(actual, expected, 'close is chainable');
+
+ el = $('<div></div>').dialog();
+ ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible before close method called');
+ el.dialog('close');
+ ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog hidden after close method called');
+});
+
+test("isOpen", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ equals(el.dialog('isOpen'), true, "dialog is open after init");
+ el.dialog('close');
+ equals(el.dialog('isOpen'), false, "dialog is closed");
+ el.remove();
+
+ el = $('<div></div>').dialog({autoOpen: false});
+ equals(el.dialog('isOpen'), false, "dialog is closed after init");
+ el.dialog('open');
+ equals(el.dialog('isOpen'), true, "dialog is open");
+ el.remove();
+});
+
+test("moveToTop", function() {
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('moveToTop');
+ equals(actual, expected, 'moveToTop is chainable');
+
+ var d1 = $('<div></div>').dialog(), dlg1 = d1.parents('.ui-dialog');
+ d1.dialog('close');
+ d1.dialog('open');
+ var d2 = $('<div></div>').dialog(), dlg2 = d2.parents('.ui-dialog');
+ d2.dialog('close');
+ d2.dialog('open');
+ ok(dlg1.css('zIndex') < dlg2.css('zIndex'), 'dialog 1 under dialog 2 before moveToTop method called');
+ d1.dialog('moveToTop');
+ ok(dlg1.css('zIndex') > dlg2.css('zIndex'), 'dialog 1 above dialog 2 after moveToTop method called');
+});
+
+test("open", function() {
+ var expected = $('<div></div>').dialog(),
+ actual = expected.dialog('open');
+ equals(actual, expected, 'open is chainable');
+
+ el = $('<div></div>').dialog({ autoOpen: false });
+ ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog hidden before open method called');
+ el.dialog('open');
+ ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible after open method called');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js
new file mode 100644
index 0000000..eab577c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js
@@ -0,0 +1,444 @@
+/*
+ * dialog_options.js
+ */
+(function($) {
+
+module("dialog: options");
+
+test("autoOpen", function() {
+ expect(2);
+
+ el = $('<div></div>').dialog({ autoOpen: false });
+ isNotOpen('.dialog({ autoOpen: false })');
+ el.remove();
+
+ el = $('<div></div>').dialog({ autoOpen: true });
+ isOpen('.dialog({ autoOpen: true })');
+ el.remove();
+});
+
+test("buttons", function() {
+ expect(21);
+
+ var buttons = {
+ "Ok": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[0], "event target");
+ },
+ "Cancel": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[1], "event target");
+ }
+ };
+
+ el = $('<div></div>').dialog({ buttons: buttons });
+ var btn = $("button", dlg());
+ equals(btn.length, 2, "number of buttons");
+
+ var i = 0;
+ $.each(buttons, function(key, val) {
+ equals(btn.eq(i).text(), key, "text of button " + (i+1));
+ i++;
+ });
+
+ ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container");
+ ok(el.parent().hasClass('ui-dialog-buttons'), "dialog wrapper adds class about having buttons");
+
+ btn.trigger("click");
+
+ var newButtons = {
+ "Close": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[0], "event target");
+ }
+ };
+
+ same(el.dialog("option", "buttons"), buttons, '.dialog("option", "buttons") getter');
+ el.dialog("option", "buttons", newButtons);
+ same(el.dialog("option", "buttons"), newButtons, '.dialog("option", "buttons", ...) setter');
+
+ btn = $("button", dlg());
+ equals(btn.length, 1, "number of buttons after setter");
+ btn.trigger('click');
+
+ i = 0;
+ $.each(newButtons, function(key, val) {
+ equals(btn.eq(i).text(), key, "text of button " + (i+1));
+ i += 1;
+ });
+
+ el.dialog("option", "buttons", null);
+ btn = $("button", dlg());
+ equals(btn.length, 0, "all buttons have been removed");
+ equals(el.find(".ui-dialog-buttonset").length, 0, "buttonset has been removed");
+ equals(el.parent().hasClass('ui-dialog-buttons'), false, "dialog wrapper removes class about having buttons");
+
+ el.remove();
+});
+
+test("buttons - advanced", function() {
+ expect(5);
+
+ el = $("<div></div>").dialog({
+ buttons: [
+ {
+ text: "a button",
+ "class": "additional-class",
+ id: "my-button-id",
+ click: function() {
+ equals(this, el[0], "correct context");
+ }
+ }
+ ]
+ });
+ var buttons = dlg().find("button");
+ equals(buttons.length, 1, "correct number of buttons");
+ equals(buttons.attr("id"), "my-button-id", "correct id");
+ equals(buttons.text(), "a button", "correct label");
+ ok(buttons.hasClass("additional-class"), "additional classes added");
+ buttons.click();
+
+ el.remove();
+});
+
+test("closeOnEscape", function() {
+ el = $('<div></div>').dialog({ closeOnEscape: false });
+ ok(true, 'closeOnEscape: false');
+ ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC');
+ el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE });
+ ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open after ESC');
+
+ el.remove();
+
+ el = $('<div></div>').dialog({ closeOnEscape: true });
+ ok(true, 'closeOnEscape: true');
+ ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC');
+ el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE });
+ ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog is closed after ESC');
+});
+
+test("closeText", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'close',
+ 'default close text');
+ el.remove();
+
+ el = $('<div></div>').dialog({ closeText: "foo" });
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'foo',
+ 'closeText on init');
+ el.remove();
+
+ el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar');
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'bar',
+ 'closeText via option method');
+ el.remove();
+});
+
+test("dialogClass", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added');
+ el.remove();
+
+ el = $('<div></div>').dialog({ dialogClass: "foo" });
+ equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added');
+ el.remove();
+
+ el = $('<div></div>').dialog({ dialogClass: "foo bar" });
+ equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added');
+ equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added');
+ el.remove();
+});
+
+test("draggable", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog({ draggable: false });
+ shouldnotmove();
+ el.dialog('option', 'draggable', true);
+ shouldmove();
+ el.remove();
+
+ el = $('<div></div>').dialog({ draggable: true });
+ shouldmove();
+ el.dialog('option', 'draggable', false);
+ shouldnotmove();
+ el.remove();
+});
+
+test("height", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().height(), 150, "default height");
+ el.remove();
+
+ el = $('<div></div>').dialog({ height: 237 });
+ equals(dlg().height(), 237, "explicit height");
+ el.remove();
+
+ el = $('<div></div>').dialog();
+ el.dialog('option', 'height', 238);
+ equals(dlg().height(), 238, "explicit height set after init");
+ el.remove();
+});
+
+test("maxHeight", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ maxHeight: 200 });
+ drag('.ui-resizable-s', 1000, 1000);
+ equals(heightAfter, 200, "maxHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxHeight: 200 });
+ drag('.ui-resizable-n', -1000, -1000);
+ equals(heightAfter, 200, "maxHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxHeight: 200 }).dialog('option', 'maxHeight', 300);
+ drag('.ui-resizable-s', 1000, 1000);
+ equals(heightAfter, 300, "maxHeight");
+ el.remove();
+});
+
+test("maxWidth", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ maxWidth: 200 });
+ drag('.ui-resizable-e', 1000, 1000);
+ equals(widthAfter, 200, "maxWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxWidth: 200 });
+ drag('.ui-resizable-w', -1000, -1000);
+ equals(widthAfter, 200, "maxWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxWidth: 200 }).dialog('option', 'maxWidth', 300);
+ drag('.ui-resizable-w', -1000, -1000);
+ equals(widthAfter, 300, "maxWidth");
+ el.remove();
+});
+
+test("minHeight", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ minHeight: 10 });
+ drag('.ui-resizable-s', -1000, -1000);
+ equals(heightAfter, 10, "minHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minHeight: 10 });
+ drag('.ui-resizable-n', 1000, 1000);
+ equals(heightAfter, 10, "minHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minHeight: 10 }).dialog('option', 'minHeight', 30);
+ drag('.ui-resizable-n', 1000, 1000);
+ equals(heightAfter, 30, "minHeight");
+ el.remove();
+});
+
+test("minWidth", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ minWidth: 10 });
+ drag('.ui-resizable-e', -1000, -1000);
+ equals(widthAfter, 10, "minWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minWidth: 10 });
+ drag('.ui-resizable-w', 1000, 1000);
+ equals(widthAfter, 10, "minWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minWidth: 30 }).dialog('option', 'minWidth', 30);
+ drag('.ui-resizable-w', 1000, 1000);
+ equals(widthAfter, 30, "minWidth");
+ el.remove();
+});
+
+test("position, default center on window", function() {
+ var el = $('<div></div>').dialog();
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
+ same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, top on window", function() {
+ var el = $('<div></div>').dialog({ position: "top" });
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
+ same(offset.top, $(window).scrollTop());
+ el.remove();
+});
+
+test("position, left on window", function() {
+ var el = $('<div></div>').dialog({ position: "left" });
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, 0);
+ same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, right bottom on window", function() {
+ var el = $('<div></div>').dialog({ position: "right bottom" });
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
+ same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, right bottom on window w/array", function() {
+ var el = $('<div></div>').dialog({ position: ["right", "bottom"] });
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
+ same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, offset from top left w/array", function() {
+ var el = $('<div></div>').dialog({ position: [10, 10] });
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+ same(offset.left, 10 + $(window).scrollLeft());
+ same(offset.top, 10 + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, right bottom at right bottom via ui.position args", function() {
+ var el = $('<div></div>').dialog({
+ position: {
+ my: "right bottom",
+ at: "right bottom"
+ }
+ });
+
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+
+ same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
+ same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
+ el.remove();
+});
+
+test("position, at another element", function() {
+ var parent = $('<div></div>').css({
+ position: 'absolute',
+ top: 400,
+ left: 600,
+ height: 10,
+ width: 10
+ }).appendTo('body');
+
+ var el = $('<div></div>').dialog({
+ position: {
+ my: "left top",
+ at: "left top",
+ of: parent
+ }
+ });
+
+ var dialog = el.dialog('widget');
+ var offset = dialog.offset();
+
+ same(offset.left, 600);
+ same(offset.top, 400);
+
+ el.dialog('option', 'position', {
+ my: "left top",
+ at: "right bottom",
+ of: parent
+ });
+
+ var offset = dialog.offset();
+
+ same(offset.left, 610);
+ same(offset.top, 410);
+
+ el.remove();
+ parent.remove();
+});
+
+test("resizable", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ shouldresize("[default]");
+ el.dialog('option', 'resizable', false);
+ shouldnotresize('disabled after init');
+ el.remove();
+
+ el = $('<div></div>').dialog({ resizable: false });
+ shouldnotresize("disabled in init options");
+ el.dialog('option', 'resizable', true);
+ shouldresize('enabled after init');
+ el.remove();
+});
+
+test("title", function() {
+ expect(9);
+
+ function titleText() {
+ return dlg().find(".ui-dialog-title").html();
+ }
+
+ el = $('<div></div>').dialog();
+ // some browsers return a non-breaking space and some return "&nbsp;"
+ // so we get the text to normalize to the actual non-breaking space
+ equals(dlg().find(".ui-dialog-title").text(), " ", "[default]");
+ equals(el.dialog("option", "title"), "", "option not changed");
+ el.remove();
+
+ el = $('<div title="foo">').dialog();
+ equals(titleText(), "foo", "title in element attribute");
+ equals(el.dialog("option", "title"), "foo", "option updated from attribute");
+ el.remove();
+
+ el = $('<div></div>').dialog({ title: 'foo' });
+ equals(titleText(), "foo", "title in init options");
+ equals(el.dialog("option", "title"), "foo", "opiton set from options hash");
+ el.remove();
+
+ el = $('<div title="foo">').dialog({ title: 'bar' });
+ equals(titleText(), "bar", "title in init options should override title in element attribute");
+ equals(el.dialog("option", "title"), "bar", "opiton set from options hash");
+ el.remove();
+
+ el = $('<div></div>').dialog().dialog('option', 'title', 'foo');
+ equals(titleText(), 'foo', 'title after init');
+ el.remove();
+});
+
+test("width", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().width(), 300, "default width");
+ el.remove();
+
+ el = $('<div></div>').dialog({width: 437 });
+ equals(dlg().width(), 437, "explicit width");
+ el.dialog('option', 'width', 438);
+ equals(dlg().width(), 438, 'explicit width after init');
+ el.remove();
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js
new file mode 100644
index 0000000..b203ca7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js
@@ -0,0 +1,143 @@
+/*
+ * dialog_tickets.js
+ */
+(function($) {
+
+module( "dialog: tickets" );
+
+asyncTest( "#3123: Prevent tabbing out of modal dialogs", function() {
+ expect( 3 );
+
+ var el = $( "<div><input id='t3123-first'><input id='t3123-last'></div>" ).dialog({ modal: true }),
+ inputs = el.find( "input" ),
+ widget = el.dialog( "widget" );
+
+ inputs.eq( 1 ).focus();
+ equal( document.activeElement, inputs[1], "Focus set on second input" );
+ inputs.eq( 1 ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB });
+
+ setTimeout( checkTab, 2 );
+
+ function checkTab() {
+ ok( $.contains( widget, document.activeElement ), "Tab key event moved focus within the modal" );
+
+ // check shift tab
+ $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB, shiftKey: true });
+ setTimeout( checkShiftTab, 2 );
+ }
+
+ function checkShiftTab() {
+ ok( $.contains( widget, document.activeElement ), "Shift-Tab key event moved focus within the modal" );
+
+ el.remove();
+ start();
+ }
+});
+
+test("#4826: setting resizable false toggles resizable on dialog", function() {
+ expect(6);
+
+ el = $('<div></div>').dialog({ resizable: false });
+ shouldnotresize("[default]");
+ for (var i=0; i<2; i++) {
+ el.dialog('close').dialog('open');
+ shouldnotresize('initialized with resizable false toggle ('+ (i+1) +')');
+ }
+ el.remove();
+
+ el = $('<div></div>').dialog({ resizable: true });
+ shouldresize("[default]");
+ for (var i=0; i<2; i++) {
+ el.dialog('close').dialog('option', 'resizable', false).dialog('open');
+ shouldnotresize('set option resizable false toggle ('+ (i+1) +')');
+ }
+ el.remove();
+
+});
+
+test("#5184: isOpen in dialogclose event is true", function() {
+ expect( 3 );
+
+ el = $( "<div></div>" ).dialog({
+ close: function() {
+ ok( !el.dialog("isOpen"), "dialog is not open during close" );
+ }
+ });
+ ok( el.dialog("isOpen"), "dialog is open after init" );
+ el.dialog( "close" );
+ ok( !el.dialog("isOpen"), "dialog is not open after close" );
+ el.remove();
+});
+
+test("#5531: dialog width should be at least minWidth on creation", function () {
+ el = $('<div></div>').dialog({
+ width: 200,
+ minWidth: 300
+ });
+
+ equals(el.dialog('option', 'width'), 300, "width is minWidth");
+ el.dialog('option', 'width', 200);
+ equals(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth");
+ el.dialog('option', 'width', 320);
+ equals(el.dialog('option', 'width'), 320, "width changed if set to > minWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({
+ minWidth: 300
+ });
+ ok(el.dialog('option', 'width') >= 300, "width is at least 300");
+ el.remove();
+
+});
+
+test("#6137: dialog('open') causes form elements to reset on IE7", function() {
+ expect(2);
+
+ d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' +
+ '<input type="radio" name="radio" id="b" value="b">b</input></form>').appendTo( "body" ).dialog({autoOpen: false});
+
+ d1.find('#b').prop( "checked", true );
+ equal($('input:checked').val(), 'b', "checkbox b is checked");
+
+ d1.dialog('open');
+ equal($('input:checked').val(), 'b', "checkbox b is checked");
+
+ d1.remove();
+});
+
+test("#6645: Missing element not found check in overlay", function(){
+ expect(2);
+ d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true});
+ d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove()}});
+ equals($.ui.dialog.overlay.instances.length, 2, 'two overlays created');
+ d2.dialog('close');
+ equals($.ui.dialog.overlay.instances.length, 1, 'one overlay remains after closing the 2nd overlay');
+ d1.add(d2).remove();
+});
+
+test("#6966: Escape key closes all dialogs, not the top one", function(){
+ expect(8);
+ // test with close function removing dialog
+ d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true});
+ d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove()}});
+ ok(d1.dialog("isOpen"), 'first dialog is open');
+ ok(d2.dialog("isOpen"), 'second dialog is open');
+ d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
+ ok(d1.dialog("isOpen"), 'first dialog still open');
+ ok(!d2.data('dialog'), 'second dialog is closed');
+ d2.remove();
+ d1.remove();
+
+ // test without close function removing dialog
+ d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true});
+ d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true});
+ ok(d1.dialog("isOpen"), 'first dialog is open');
+ ok(d2.dialog("isOpen"), 'second dialog is open');
+ d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
+ ok(d1.dialog("isOpen"), 'first dialog still open');
+ ok(!d2.dialog("isOpen"), 'second dialog is closed');
+ d2.remove();
+ d1.remove();
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html
new file mode 100644
index 0000000..3796d3f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Draggable Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "draggable" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Draggable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html
new file mode 100644
index 0000000..5be71f4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Draggable Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.draggable.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="draggable_core.js"></script>
+ <script src="draggable_defaults.js"></script>
+ <script src="draggable_events.js"></script>
+ <script src="draggable_methods.js"></script>
+ <script src="draggable_options.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("draggable", function() { ok(true, "disabled draggable testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Draggable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="draggable1" style="background: green; width: 200px; height: 100px;">Relative</div>
+<div id="draggable2" style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span>Absolute</span></div>
+<div style='width: 1px; height: 1000px;'></div>
+<div style="position: absolute; width: 1px; height: 2000px;"></div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js
new file mode 100644
index 0000000..a01de40
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js
@@ -0,0 +1,67 @@
+/*
+ * draggable_core.js
+ */
+
+var el, offsetBefore, offsetAfter, dragged;
+
+var drag = function(handle, dx, dy) {
+ var element = el.data("draggable").element;
+ offsetBefore = el.offset();
+ $(handle).simulate("drag", {
+ dx: dx || 0,
+ dy: dy || 0
+ });
+ dragged = { dx: dx, dy: dy };
+ offsetAfter = el.offset();
+}
+
+var moved = function (dx, dy, msg) {
+ msg = msg ? msg + "." : "";
+ var actual = { left: offsetAfter.left, top: offsetAfter.top };
+ var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy };
+ same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
+}
+
+function restoreScroll(what) {
+ if(what) {
+ $(document).scrollTop(0); $(document).scrollLeft(0);
+ } else {
+ $("#main")[0].scrollTop = 0; $("#main")[0].scrollLeft = 0;
+ }
+}
+
+(function($) {
+
+module("draggable");
+
+test("element types", function() {
+ var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
+ + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
+ + ',acronym,code,samp,kbd,var,img,object,hr'
+ + ',input,button,label,select,iframe').split(',');
+
+ $.each(typeNames, function(i) {
+ var typeName = typeNames[i];
+ el = $(document.createElement(typeName)).appendTo('body');
+ (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
+ el.draggable({ cancel: '' });
+ drag(el, 50, 50);
+ moved(50, 50, "&lt;" + typeName + "&gt;");
+ el.draggable("destroy");
+ el.remove();
+ });
+});
+
+test("No options, relative", function() {
+ el = $("#draggable1").draggable();
+ drag(el, 50, 50);
+ moved(50, 50);
+});
+
+test("No options, absolute", function() {
+ el = $("#draggable2").draggable();
+ drag(el, 50, 50);
+ moved(50, 50);
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js
new file mode 100644
index 0000000..4b0aaca
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js
@@ -0,0 +1,36 @@
+/*
+ * draggable_defaults.js
+ */
+
+var draggable_defaults = {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ disabled: false,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+};
+
+commonWidgetTests('draggable', { defaults: draggable_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js
new file mode 100644
index 0000000..d92d8ee
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js
@@ -0,0 +1,81 @@
+/*
+ * draggable_events.js
+ */
+(function($) {
+
+module("draggable: events");
+
+test("callbacks occurance count", function() {
+
+ expect(3);
+
+ var start = 0, stop = 0, dragc = 0;
+ el = $("#draggable2").draggable({
+ start: function() { start++; },
+ drag: function() { dragc++; },
+ stop: function() { stop++; }
+ });
+
+ drag(el, 10, 10);
+
+ equals(start, 1, "start callback should happen exactly once");
+ equals(dragc, 3, "drag callback should happen exactly once per mousemove");
+ equals(stop, 1, "stop callback should happen exactly once");
+
+});
+
+test("stopping the start callback", function() {
+
+ expect(3);
+
+ var start = 0, stop = 0, dragc = 0;
+ el = $("#draggable2").draggable({
+ start: function() { start++; return false; },
+ drag: function() { dragc++; },
+ stop: function() { stop++; }
+ });
+
+ drag(el, 10, 10);
+
+ equals(start, 1, "start callback should happen exactly once");
+ equals(dragc, 0, "drag callback should not happen at all");
+ equals(stop, 0, "stop callback should not happen if there wasnt even a start");
+
+});
+
+test("stopping the drag callback", function() {
+
+ expect(3);
+
+ var start = 0, stop = 0, dragc = 0;
+ el = $("#draggable2").draggable({
+ start: function() { start++;},
+ drag: function() { dragc++; return false; },
+ stop: function() { stop++; }
+ });
+
+ drag(el, 10, 10);
+
+ equals(start, 1, "start callback should happen exactly once");
+ equals(dragc, 1, "drag callback should happen exactly once");
+ equals(stop, 1, "stop callback should happen, as we need to actively stop the drag");
+
+});
+
+test("stopping the stop callback", function() {
+
+ expect(1);
+
+ el = $("#draggable2").draggable({
+ helper: 'clone',
+ stop: function() { return false; }
+ });
+
+ drag(el, 10, 10);
+
+ ok($("#draggable2").data('draggable').helper, "the clone should not be deleted if the stop callback is stopped");
+
+
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js
new file mode 100644
index 0000000..4ffadf0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js
@@ -0,0 +1,99 @@
+/*
+ * draggable_methods.js
+ */
+(function($) {
+
+function shouldmove(why) {
+ drag(el, 50, 50);
+ moved(50, 50, why);
+}
+
+function shouldnotmove(why) {
+ drag(el, 50, 50);
+ moved(0, 0, why);
+}
+
+module("draggable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').draggable().remove();
+ ok(true, '.draggable() called on element');
+
+ $([]).draggable();
+ ok(true, '.draggable() called on empty collection');
+
+ $("<div></div>").draggable();
+ ok(true, '.draggable() called on disconnected DOMElement');
+
+ $("<div></div>").draggable().draggable("foo");
+ ok(true, 'arbitrary method called after init');
+
+ $("<div></div>").draggable().draggable("option", "foo");
+ ok(true, 'arbitrary option getter after init');
+
+ $("<div></div>").draggable().draggable("option", "foo", "bar");
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').draggable().draggable("destroy").remove();
+ ok(true, '.draggable("destroy") called on element');
+
+ $([]).draggable().draggable("destroy");
+ ok(true, '.draggable("destroy") called on empty collection');
+
+ $("<div></div>").draggable().draggable("destroy");
+ ok(true, '.draggable("destroy") called on disconnected DOMElement');
+
+ $("<div></div>").draggable().draggable("destroy").draggable("foo");
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').draggable(),
+ actual = expected.draggable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ expect(7);
+ el = $("#draggable2").draggable({ disabled: true });
+ shouldnotmove('.draggable({ disabled: true })');
+ el.draggable("enable");
+ shouldmove('.draggable("enable")');
+ equals(el.draggable("option", "disabled"), false, "disabled option getter");
+
+ el.draggable("destroy");
+ el.draggable({ disabled: true });
+ shouldnotmove('.draggable({ disabled: true })');
+ el.draggable("option", "disabled", false);
+ equals(el.draggable("option", "disabled"), false, "disabled option setter");
+ shouldmove('.draggable("option", "disabled", false)');
+
+ var expected = $('<div></div>').draggable(),
+ actual = expected.draggable('enable');
+ equals(actual, expected, 'enable is chainable');
+});
+
+test("disable", function() {
+ expect(7);
+ el = $("#draggable2").draggable({ disabled: false });
+ shouldmove('.draggable({ disabled: false })');
+ el.draggable("disable");
+ shouldnotmove('.draggable("disable")');
+ equals(el.draggable("option", "disabled"), true, "disabled option getter");
+
+ el.draggable("destroy");
+
+ el.draggable({ disabled: false });
+ shouldmove('.draggable({ disabled: false })');
+ el.draggable("option", "disabled", true);
+ equals(el.draggable("option", "disabled"), true, "disabled option setter");
+ shouldnotmove('.draggable("option", "disabled", true)');
+
+ var expected = $('<div></div>').draggable(),
+ actual = expected.draggable('disable');
+ equals(actual, expected, 'disable is chainable');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js
new file mode 100644
index 0000000..8ba77fb
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js
@@ -0,0 +1,753 @@
+/*
+ * draggable_options.js
+ */
+(function($) {
+
+function testScroll(position) {
+ $("#main").css('position', position);
+ drag(el, 50, 50);
+ moved(50, 50, position+' parent');
+}
+
+function setScroll(what) {
+ if(what) {
+ $(document).scrollTop(100); $(document).scrollLeft(100);
+ } else {
+ $("#main")[0].scrollTop = 100; $("#main")[0].scrollLeft = 100;
+ }
+}
+
+var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); }
+
+var margin = function(el, side) { return parseInt(el.css('margin-' + side)); }
+
+module("draggable: options");
+
+test("{ addClasses: true }, default", function() {
+ equals(draggable_defaults.addClasses, true);
+
+ el = $("<div></div>").draggable({ addClasses: true });
+ ok(el.is(".ui-draggable"), "'ui-draggable' class added");
+
+ el.draggable("destroy");
+});
+
+test("{ addClasses: false }", function() {
+ el = $("<div></div>").draggable({ addClasses: false });
+ ok(!el.is(".ui-draggable"), "'ui-draggable' class not added");
+
+ el.draggable("destroy");
+});
+
+test("{ appendTo: 'parent' }, default", function() {
+ equals(draggable_defaults.appendTo, "parent");
+
+ el = $("#draggable2").draggable({ appendTo: 'parent' });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: 'parent' });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+});
+
+test("{ appendTo: Element }", function() {
+ el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] });
+ drag(el, 50, 50);
+ moved(50, 50);
+});
+
+test("{ appendTo: Selector }", function() {
+ el = $("#draggable2").draggable({ appendTo: "#main" });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: "#main" });
+ drag(el, 50, 50);
+ moved(50, 50);
+});
+
+test("{ axis: false }, default", function() {
+ equals(draggable_defaults.axis, false);
+
+ el = $("#draggable2").draggable({ axis: false });
+ drag(el, 50, 50);
+ moved(50, 50);
+});
+
+test("{ axis: 'x' }", function() {
+ el = $("#draggable2").draggable({ axis: "x" });
+ drag(el, 50, 50);
+ moved(50, 0);
+});
+
+test("{ axis: 'y' }", function() {
+ el = $("#draggable2").draggable({ axis: "y" });
+ drag(el, 50, 50);
+ moved(0, 50);
+});
+
+test("{ axis: ? }, unexpected", function() {
+ var unexpected = {
+ "true": true,
+ "{}": {},
+ "[]": [],
+ "null": null,
+ "undefined": undefined,
+ "function() {}": function() {}
+ };
+ $.each(unexpected, function(key, val) {
+ el = $("#draggable2").draggable({ axis: val });
+ drag(el, 50, 50);
+ moved(50, 50, "axis: " + key);
+ el.draggable("destroy");
+ })
+});
+
+test("{ cancel: ':input,option' }, default", function() {
+ equals(draggable_defaults.cancel, ":input,option");
+
+ $('<div id="draggable-option-cancel-default"><input type="text"></div>').appendTo('#main');
+
+ el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" });
+ drag("#draggable-option-cancel-default", 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" });
+ drag("#draggable-option-cancel-default :input", 50, 50);
+ moved(0, 0);
+
+ el.draggable("destroy");
+});
+
+test("{ cancel: 'span' }", function() {
+ el = $("#draggable2").draggable();
+ drag("#draggable2 span", 50, 50);
+ moved(50, 50);
+
+ el.draggable("destroy");
+
+ el = $("#draggable2").draggable({ cancel: 'span' });
+ drag("#draggable2 span", 50, 50);
+ moved(0, 0);
+});
+
+test("{ cancel: ? }, unexpected", function() {
+ var unexpected = {
+ "true": true,
+ "false": false,
+ "{}": {},
+ "[]": [],
+ "null": null,
+ "undefined": undefined,
+ "function() {return '';}": function() {return '';},
+ "function() {return true;}": function() {return true;},
+ "function() {return false;}": function() {return false;}
+ };
+ $.each(unexpected, function(key, val) {
+ el = $("#draggable2").draggable({ cancel: val });
+ drag(el, 50, 50);
+ var expected = [50, 50];
+ moved(expected[0], expected[1], "cancel: " + key);
+ el.draggable("destroy");
+ })
+});
+
+test("{ containment: false }, default", function() {
+ equals(draggable_defaults.containment, false);
+
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ containment: Element }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ containment: 'parent' }, relative", function() {
+ el = $("#draggable1").draggable({ containment: 'parent' });
+ var p = el.parent(), po = p.offset();
+ drag(el, -100, -100);
+ var expected = {
+ left: po.left + border(p, 'left') + margin(el, 'left'),
+ top: po.top + border(p, 'top') + margin(el, 'top')
+ }
+ same(offsetAfter, expected, 'compare offset to parent');
+});
+
+test("{ containment: 'parent' }, absolute", function() {
+ el = $("#draggable2").draggable({ containment: 'parent' });
+ var p = el.parent(), po = p.offset();
+ drag(el, -100, -100);
+ var expected = {
+ left: po.left + border(p, 'left') + margin(el, 'left'),
+ top: po.top + border(p, 'top') + margin(el, 'top')
+ }
+ same(offsetAfter, expected, 'compare offset to parent');
+});
+
+test("{ containment: 'document' }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ containment: 'window' }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ containment: Selector }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ containment: [x1, y1, x2, y2] }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ cursor: 'auto' }, default", function() {
+ equals(draggable_defaults.cursor, 'auto');
+
+ function getCursor() { return $("#draggable2").css("cursor"); }
+
+ expect(3);
+
+ var expected = "auto", actual, before, after;
+
+ el = $("#draggable2").draggable({
+ cursor: expected,
+ start: function(event, ui) {
+ actual = getCursor();
+ }
+ });
+
+ before = getCursor();
+ drag("#draggable2", -1, -1);
+ after = getCursor();
+
+ equals(actual, expected, "start callback: cursor '" + expected + "'");
+ equals(after, before, "after drag: cursor restored");
+
+});
+
+test("{ cursor: 'move' }", function() {
+
+ function getCursor() { return $("body").css("cursor"); }
+
+ expect(2);
+
+ var expected = "move", actual, before, after;
+
+ el = $("#draggable2").draggable({
+ cursor: expected,
+ start: function(event, ui) {
+ actual = getCursor();
+ }
+ });
+
+ before = getCursor();
+ drag("#draggable2", -1, -1);
+ after = getCursor();
+
+ equals(actual, expected, "start callback: cursor '" + expected + "'");
+ equals(after, before, "after drag: cursor restored");
+
+});
+
+test("{ cursorAt: false}, default", function() {
+ equals(draggable_defaults.cursorAt, false);
+
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ cursorAt: { left: -5, top: -5 } }", function() {
+ expect(4);
+
+ var deltaX = -3, deltaY = -3,
+ offsetX = 5, offsetY = 5,
+ cursorAtX = -5, cursorAtY = -5;
+
+ $.each(['relative', 'absolute'], function(i, position) {
+ var el = $('#draggable' + (i + 1)).draggable({
+ cursorAt: { left: cursorAtX, top: cursorAtY },
+ drag: function(event, ui) {
+ equals(ui.offset.left, expected.left, position + ' left');
+ equals(ui.offset.top, expected.top, position + ' top');
+ }
+ }),
+ before = el.offset(),
+ pos = {
+ clientX: before.left + offsetX,
+ clientY: before.top + offsetY
+ },
+ expected = {
+ left: before.left + offsetX - cursorAtX + deltaX,
+ top: before.top + offsetY - cursorAtY + deltaY
+ };
+
+ el.simulate("mousedown", pos);
+ pos.clientX += deltaX;
+ pos.clientY += deltaY;
+ $(document).simulate("mousemove", pos);
+ el.simulate("mouseup", pos);
+ });
+});
+
+test("{ cursorAt: { right: 10, bottom: 20 } }", function() {
+ expect(4);
+
+ var deltaX = -3, deltaY = -3,
+ offsetX = 5, offsetY = 5,
+ cursorAtX = 10, cursorAtY = 20;
+
+ $.each(['relative', 'absolute'], function(i, position) {
+ var el = $('#draggable' + (i + 1)).draggable({
+ cursorAt: { right: cursorAtX, bottom: cursorAtY },
+ drag: function(event, ui) {
+ equals(ui.offset.left, expected.left, position + ' left');
+ equals(ui.offset.top, expected.top, position + ' top');
+ }
+ }),
+ before = el.offset(),
+ pos = {
+ clientX: before.left + offsetX,
+ clientY: before.top + offsetY
+ },
+ expected = {
+ left: before.left + offsetX - el.width() + cursorAtX + deltaX,
+ top: before.top + offsetY - el.height() + cursorAtY + deltaY
+ };
+
+ el.simulate("mousedown", pos);
+ pos.clientX += deltaX;
+ pos.clientY += deltaY;
+ $(document).simulate("mousemove", pos);
+ el.simulate("mouseup", pos);
+ });
+});
+
+test("{ cursorAt: [10, 20] }", function() {
+ expect(4);
+
+ var deltaX = -3, deltaY = -3,
+ offsetX = 5, offsetY = 5,
+ cursorAtX = 10, cursorAtY = 20;
+
+ $.each(['relative', 'absolute'], function(i, position) {
+ var el = $('#draggable' + (i + 1)).draggable({
+ cursorAt: { left: cursorAtX, top: cursorAtY },
+ drag: function(event, ui) {
+ equals(ui.offset.left, expected.left, position + ' left');
+ equals(ui.offset.top, expected.top, position + ' top');
+ }
+ }),
+ before = el.offset(),
+ pos = {
+ clientX: before.left + offsetX,
+ clientY: before.top + offsetY
+ },
+ expected = {
+ left: before.left + offsetX - cursorAtX + deltaX,
+ top: before.top + offsetY - cursorAtY + deltaY
+ };
+
+ el.simulate("mousedown", pos);
+ pos.clientX += deltaX;
+ pos.clientY += deltaY;
+ $(document).simulate("mousemove", pos);
+ el.simulate("mouseup", pos);
+ });
+});
+
+test("{ cursorAt: '20, 40' }", function() {
+ expect(4);
+
+ var deltaX = -3, deltaY = -3,
+ offsetX = 5, offsetY = 5,
+ cursorAtX = 20, cursorAtY = 40;
+
+ $.each(['relative', 'absolute'], function(i, position) {
+ var el = $('#draggable' + (i + 1)).draggable({
+ cursorAt: { left: cursorAtX, top: cursorAtY },
+ drag: function(event, ui) {
+ equals(ui.offset.left, expected.left, position + ' left');
+ equals(ui.offset.top, expected.top, position + ' top');
+ }
+ }),
+ before = el.offset(),
+ pos = {
+ clientX: before.left + offsetX,
+ clientY: before.top + offsetY
+ },
+ expected = {
+ left: before.left + offsetX - cursorAtX + deltaX,
+ top: before.top + offsetY - cursorAtY + deltaY
+ };
+
+ el.simulate("mousedown", pos);
+ pos.clientX += deltaX;
+ pos.clientY += deltaY;
+ $(document).simulate("mousemove", pos);
+ el.simulate("mouseup", pos);
+ });
+});
+
+test("{ distance: 10 }", function() {
+
+ el = $("#draggable2").draggable({ distance: 10 });
+ drag(el, -9, -9);
+ moved(0, 0, 'distance not met');
+
+ drag(el, -10, -10);
+ moved(-10, -10, 'distance met');
+
+ drag(el, 9, 9);
+ moved(0, 0, 'distance not met');
+
+});
+
+test("{ grid: [50, 50] }, relative", function() {
+ el = $("#draggable1").draggable({ grid: [50, 50] });
+ drag(el, 24, 24);
+ moved(0, 0);
+ drag(el, 26, 25);
+ moved(50, 50);
+});
+
+test("{ grid: [50, 50] }, absolute", function() {
+ el = $("#draggable2").draggable({ grid: [50, 50] });
+ drag(el, 24, 24);
+ moved(0, 0);
+ drag(el, 26, 25);
+ moved(50, 50);
+});
+
+test("{ handle: 'span' }", function() {
+ el = $("#draggable2").draggable({ handle: 'span' });
+
+ drag("#draggable2 span", 50, 50);
+ moved(50, 50, "drag span");
+
+ drag("#draggable2", 50, 50);
+ moved(0, 0, "drag element");
+});
+
+test("{ helper: 'clone' }, relative", function() {
+ el = $("#draggable1").draggable({ helper: "clone" });
+ drag(el, 50, 50);
+ moved(0, 0);
+});
+
+test("{ helper: 'clone' }, absolute", function() {
+ el = $("#draggable2").draggable({ helper: "clone" });
+ drag(el, 50, 50);
+ moved(0, 0);
+});
+
+test("{ helper: 'original' }, relative, with scroll offset on parent", function() {
+
+ el = $("#draggable1").draggable({ helper: "original" });
+
+ setScroll();
+ testScroll('relative');
+
+ setScroll();
+ testScroll('static');
+
+ setScroll();
+ testScroll('absolute');
+
+ restoreScroll();
+
+});
+
+test("{ helper: 'original' }, relative, with scroll offset on root", function() {
+
+ el = $("#draggable1").draggable({ helper: "original" });
+
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll('root');
+ testScroll('static');
+
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() {
+
+ el = $("#draggable1").draggable({ helper: "original" });
+
+ setScroll();
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll();
+ setScroll('root');
+ testScroll('static');
+
+ setScroll();
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll();
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'original' }, absolute, with scroll offset on parent", function() {
+
+ el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll();
+ testScroll('relative');
+
+ setScroll();
+ testScroll('static');
+
+ setScroll();
+ testScroll('absolute');
+
+ restoreScroll();
+
+});
+
+test("{ helper: 'original' }, absolute, with scroll offset on root", function() {
+
+ el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll('root');
+ testScroll('static');
+
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() {
+
+ el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll();
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll();
+ setScroll('root');
+ testScroll('static');
+
+ setScroll();
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll();
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
+
+ el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll();
+ testScroll('relative');
+
+ setScroll();
+ testScroll('static');
+
+ setScroll();
+ testScroll('absolute');
+
+ restoreScroll();
+
+});
+
+test("{ helper: 'original' }, fixed, with scroll offset on root", function() {
+
+ el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll('root');
+ testScroll('static');
+
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll('root');
+});
+
+test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() {
+
+ el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
+
+ setScroll();
+ setScroll('root');
+ testScroll('relative');
+
+ setScroll();
+ setScroll('root');
+ testScroll('static');
+
+ setScroll();
+ setScroll('root');
+ testScroll('absolute');
+
+ restoreScroll();
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'clone' }, absolute", function() {
+
+ var helperOffset = null;
+ var origOffset = $("#draggable1").offset();
+
+ el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
+ helperOffset = ui.helper.offset();
+ } });
+
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+});
+
+test("{ helper: 'clone' }, absolute with scroll offset on parent", function() {
+
+ setScroll();
+ var helperOffset = null;
+ var origOffset = null;
+
+ el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
+ helperOffset = ui.helper.offset();
+ } });
+
+ $("#main").css('position', 'relative');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'static');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'absolute');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ restoreScroll();
+
+});
+
+test("{ helper: 'clone' }, absolute with scroll offset on root", function() {
+
+ setScroll('root');
+ var helperOffset = null;
+ var origOffset = null;
+
+ el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
+ helperOffset = ui.helper.offset();
+ } });
+
+ $("#main").css('position', 'relative');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'static');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'absolute');
+ origOffset = $("#draggable1").offset();
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ restoreScroll('root');
+
+});
+
+test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() {
+
+ setScroll('root');
+ setScroll();
+ var helperOffset = null;
+ var origOffset = null;
+
+ el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
+ helperOffset = ui.helper.offset();
+ } });
+
+ $("#main").css('position', 'relative');
+ origOffset = $("#draggable1").offset()
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'static');
+ origOffset = $("#draggable1").offset()
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ $("#main").css('position', 'absolute');
+ origOffset = $("#draggable1").offset()
+ drag(el, 1, 1);
+ same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
+ restoreScroll('root');
+ restoreScroll();
+
+});
+
+test("{ opacity: 0.5 }", function() {
+
+ expect(1);
+
+ var opacity = null;
+ el = $("#draggable2").draggable({
+ opacity: 0.5,
+ start: function(event, ui) {
+ opacity = $(this).css("opacity");
+ }
+ });
+
+ drag("#draggable2", -1, -1);
+
+ equals(opacity, 0.5, "start callback: opacity is");
+
+});
+
+test("{ zIndex: 10 }", function() {
+
+ expect(1);
+
+ var expected = 10, actual;
+
+ var zIndex = null;
+ el = $("#draggable2").draggable({
+ zIndex: expected,
+ start: function(event, ui) {
+ actual = $(this).css("zIndex");
+ }
+ });
+
+ drag("#draggable2", -1, -1);
+
+ equals(actual, expected, "start callback: zIndex is");
+
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html
new file mode 100644
index 0000000..e7f274c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Droppable Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "droppable" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Droppable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html
new file mode 100644
index 0000000..abf94f0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Droppable Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.draggable.js",
+ "ui/jquery.ui.droppable.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="droppable_core.js"></script>
+ <script src="droppable_defaults.js"></script>
+ <script src="droppable_events.js"></script>
+ <script src="droppable_methods.js"></script>
+ <script src="droppable_options.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("droppable", function() { ok(true, "disabled droppable testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Droppable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="draggable1" style="width: 25px; height: 25px;">Draggable</div>
+<div id="droppable1" style="width: 100px; height: 100px;">Droppable</div>
+<div style='width:1000px;height:1000px;'>&nbsp;</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js
new file mode 100644
index 0000000..4d82017
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js
@@ -0,0 +1,36 @@
+/*
+ * droppable_core.js
+ */
+
+var el, drg;
+
+function shouldBeDroppable() {
+ ok(false, 'missing test - untested code is broken code');
+}
+
+function shouldNotBeDroppable() {
+ ok(false, 'missing test - untested code is broken code');
+}
+
+(function($) {
+
+module("droppable: core");
+
+test("element types", function() {
+ var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
+ + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
+ + ',acronym,code,samp,kbd,var,img,object,hr'
+ + ',input,button,label,select,iframe').split(',');
+
+ $.each(typeNames, function(i) {
+ var typeName = typeNames[i];
+ el = $(document.createElement(typeName)).appendTo('body');
+ (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
+ el.droppable();
+ shouldBeDroppable();
+ el.droppable("destroy");
+ el.remove();
+ });
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js
new file mode 100644
index 0000000..7584f5e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js
@@ -0,0 +1,16 @@
+/*
+ * droppable_defaults.js
+ */
+
+var droppable_defaults = {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ disabled: false,
+ greedy: false,
+ hoverClass: false,
+ scope: "default",
+ tolerance: "intersect"
+};
+
+commonWidgetTests('droppable', { defaults: droppable_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js
new file mode 100644
index 0000000..f22a035
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js
@@ -0,0 +1,28 @@
+/*
+ * droppable_events.js
+ */
+(function($) {
+
+module("droppable: events");
+
+test("activate", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("deactivate", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("over", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("out", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("drop", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js
new file mode 100644
index 0000000..87b9168
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js
@@ -0,0 +1,86 @@
+/*
+ * droppable_methods.js
+ */
+(function($) {
+
+module("droppable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').droppable().remove();
+ ok(true, '.droppable() called on element');
+
+ $([]).droppable();
+ ok(true, '.droppable() called on empty collection');
+
+ $("<div></div>").droppable();
+ ok(true, '.droppable() called on disconnected DOMElement');
+
+ $("<div></div>").droppable().droppable("foo");
+ ok(true, 'arbitrary method called after init');
+
+ $("<div></div>").droppable().droppable("option", "foo");
+ ok(true, 'arbitrary option getter after init');
+
+ $("<div></div>").droppable().droppable("option", "foo", "bar");
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').droppable().droppable("destroy").remove();
+ ok(true, '.droppable("destroy") called on element');
+
+ $([]).droppable().droppable("destroy");
+ ok(true, '.droppable("destroy") called on empty collection');
+
+ $("<div></div>").droppable().droppable("destroy");
+ ok(true, '.droppable("destroy") called on disconnected DOMElement');
+
+ $("<div></div>").droppable().droppable("destroy").droppable("foo");
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').droppable(),
+ actual = expected.droppable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ expect(7);
+ el = $("#droppable1").droppable({ disabled: true });
+ shouldNotBeDroppable();
+ el.droppable("enable");
+ shouldBeDroppable();
+ equals(el.droppable("option", "disabled"), false, "disabled option getter");
+ el.droppable("destroy");
+ el.droppable({ disabled: true });
+ shouldNotBeDroppable();
+ el.droppable("option", "disabled", false);
+ equals(el.droppable("option", "disabled"), false, "disabled option setter");
+ shouldBeDroppable();
+
+ var expected = $('<div></div>').droppable(),
+ actual = expected.droppable('enable');
+ equals(actual, expected, 'enable is chainable');
+});
+
+test("disable", function() {
+ expect(7);
+ el = $("#droppable1").droppable({ disabled: false });
+ shouldBeDroppable();
+ el.droppable("disable");
+ shouldNotBeDroppable();
+ equals(el.droppable("option", "disabled"), true, "disabled option getter");
+ el.droppable("destroy");
+ el.droppable({ disabled: false });
+ shouldBeDroppable();
+ el.droppable("option", "disabled", true);
+ equals(el.droppable("option", "disabled"), true, "disabled option setter");
+ shouldNotBeDroppable();
+
+ var expected = $('<div></div>').droppable(),
+ actual = expected.droppable('disable');
+ equals(actual, expected, 'disable is chainable');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js
new file mode 100644
index 0000000..2f2dbf6
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js
@@ -0,0 +1,68 @@
+/*
+ * droppable_options.js
+ */
+(function($) {
+
+module("droppable: options");
+
+test("{ accept '*' }, default ", function() {
+ equals(droppable_defaults.accept, '*');
+
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ accept: Selector }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ accept: function(draggable) }", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("activeClass", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("{ addClasses: true }, default", function() {
+ equals(droppable_defaults.addClasses, true);
+
+ el = $("<div></div>").droppable({ addClasses: true });
+ ok(el.is(".ui-droppable"), "'ui-droppable' class added");
+ el.droppable("destroy");
+});
+
+test("{ addClasses: false }", function() {
+ el = $("<div></div>").droppable({ addClasses: false });
+ ok(!el.is(".ui-droppable"), "'ui-droppable' class not added");
+ el.droppable("destroy");
+});
+
+test("greedy", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("hoverClass", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("scope", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("tolerance, fit", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("tolerance, intersect", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("tolerance, pointer", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+test("tolerance, touch", function() {
+ ok(false, 'missing test - untested code is broken code');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html
new file mode 100644
index 0000000..56890ba
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Effects Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "effects" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Effects Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html
new file mode 100644
index 0000000..06023c5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html
@@ -0,0 +1,117 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Effects Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script>
+ $.uiBackCompat = false;
+ </script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ js: [
+ "ui/jquery.effects.core.js",
+ "ui/jquery.effects.blind.js",
+ "ui/jquery.effects.bounce.js",
+ "ui/jquery.effects.clip.js",
+ "ui/jquery.effects.drop.js",
+ "ui/jquery.effects.explode.js",
+ "ui/jquery.effects.fade.js",
+ "ui/jquery.effects.fold.js",
+ "ui/jquery.effects.highlight.js",
+ "ui/jquery.effects.pulsate.js",
+ "ui/jquery.effects.scale.js",
+ "ui/jquery.effects.shake.js",
+ "ui/jquery.effects.slide.js",
+ "ui/jquery.effects.transfer.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+ <script src="effects_core.js"></script>
+ <script src="effects_scale.js"></script>
+
+ <script src="../swarminject.js"></script>
+ <style>
+ #qunit-fixture {
+ width: 1000px;
+ height: 1000px;
+ }
+ .hidden {
+ display: none;
+ }
+ .test {
+ background: #000;
+ border: 0;
+ width: 100px;
+ height: 100px;
+ }
+ .testAddBorder {
+ border: 10px solid #000;
+ }
+ .testChildren,
+ .testChangeBackground {
+ background: #fff;
+ }
+ .test h2 {
+ font-size: 10px;
+ }
+ .testChildren h2 {
+ font-size: 20px;
+ }
+
+ .relWidth {
+ width: 50%;
+ }
+
+ .relHeight {
+ height: 50%;
+ }
+
+ .testScale {
+ border: 5px solid #000;
+ padding: 5px;
+ margin: 5px;
+ width: 50px;
+ height: 50px;
+ }
+
+ .ticket7106 {
+ width: 50px;
+ height: 50px;
+ }
+ .ticket7106.animate {
+ width: 100px;
+ }
+
+ </style>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Effects Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+<div class="hidden test"></div>
+<div class="animateClass test">
+ <h2>Child Element Test</h2>
+</div>
+<div class="relWidth relHeight testAddBorder">
+ <h2>Slide with relative width</h2>
+</div>
+<div class="testScale">
+</div>
+<div class="ticket7106">
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js
new file mode 100644
index 0000000..aca4c46
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js
@@ -0,0 +1,182 @@
+(function($) {
+
+function present( value, array, message ) {
+ QUnit.push( jQuery.inArray( value, array ) !== -1 , value, array, message );
+}
+
+function notPresent( value, array, message ) {
+ QUnit.push( jQuery.inArray( value, array ) === -1 , value, array, message );
+}
+
+// minDuration is used for "short" animate tests where we are only concerned about the final
+var minDuration = 15,
+
+ // duration is used for "long" animates where we plan on testing properties during animation
+ duration = 200,
+
+ // mid is used for testing in the "middle" of the "duration" animations
+ mid = duration / 2;
+
+module( "effects.core" );
+
+test( "Immediate Return Conditions", function() {
+ var hidden = $( "div.hidden" ),
+ count = 0;
+ expect( 3 );
+ hidden.hide( "blind", function() {
+ equal( ++count, 1, "Hide on hidden returned immediately" );
+ }).show().show( "blind", function() {
+ equal( ++count, 2, "Show on shown returned immediately" );
+ });
+ equal( ++count, 3, "Both Functions worked properly" );
+});
+
+test( "createWrapper and removeWrapper retain focused elements (#7595)", function() {
+ expect( 2 );
+ var test = $( "div.hidden" ).show(),
+ input = $( "<input type='text'>" ).appendTo( test ).focus();
+
+ $.effects.createWrapper( test );
+ equal( document.activeElement, input[ 0 ], "Active element is still input after createWrapper" );
+ $.effects.removeWrapper( test );
+ equal( document.activeElement, input[ 0 ], "Active element is still input after removeWrapper" );
+});
+
+
+module( "effects.core: animateClass" );
+
+asyncTest( "animateClass works with borderStyle", function() {
+ var test = $("div.animateClass"),
+ count = 0;
+ expect(3);
+ test.toggleClass("testAddBorder", minDuration, function() {
+ test.toggleClass("testAddBorder", minDuration, function() {
+ equal( test.css("borderLeftStyle"), "none", "None border set" );
+ start();
+ });
+ equal( test.css("borderLeftStyle"), "solid", "None border not immedately set" );
+ });
+ equal( test.css("borderLeftStyle"), "solid", "Solid border immedately set" );
+});
+
+asyncTest( "animateClass works with colors", function() {
+ var test = $("div.animateClass"),
+ count = 0;
+ expect(2);
+ test.toggleClass("testChangeBackground", duration, function() {
+ present( test.css("backgroundColor"), [ "#ffffff", "#fff", "rgb(255, 255, 255)" ], "Color is final" );
+ start();
+ });
+ setTimeout(function() {
+ var color = test.css("backgroundColor");
+ notPresent( color, [ "#000000", "#ffffff", "#000", "#fff", "rgb(0, 0, 0)", "rgb(255,255,255)" ],
+ "Color is not endpoints in middle." );
+ }, mid);
+});
+
+asyncTest( "animateClass works with children", function() {
+ var test = $("div.animateClass"),
+ h2 = test.find("h2");
+
+ expect(4);
+ setTimeout(function() {
+ notPresent( h2.css("fontSize"), ["10px","20px"], "Font size is neither endpoint when in middle.");
+ }, mid);
+ test.toggleClass("testChildren", { children: true, duration: duration, complete: function() {
+ equal( h2.css("fontSize"), "20px", "Text size is final during complete");
+ test.toggleClass("testChildren", duration, function() {
+ equal( h2.css("fontSize"), "10px", "Text size revertted after class removed");
+
+ start();
+ });
+ setTimeout(function() {
+ equal( h2.css("fontSize"), "20px", "Text size unchanged during animate with children: undefined" );
+ }, mid);
+ }});
+});
+
+asyncTest( "animateClass clears style properties when stopped", function() {
+ var test = $("div.animateClass"),
+ style = test[0].style,
+ orig = style.cssText;
+
+ expect( 2 );
+
+ test.addClass( "testChangeBackground", duration );
+ notEqual( orig, style.cssText, "cssText is not the same after starting animation" );
+
+ test.stop( true, true );
+ equal( orig, $.trim( style.cssText ), "cssText is the same after stopping animation midway" );
+ start();
+});
+
+asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() {
+ var test = $( "div.ticket7106" );
+
+ // add a class and change a style property after starting an animated class
+ test.addClass( "animate", minDuration, animationComplete )
+ .addClass( "testClass" )
+ .height( 100 );
+
+ // ensure the class stays and that the css property stays
+ function animationComplete() {
+ ok( test.hasClass( "testClass" ), "class change during animateClass was not lost" );
+ equal( test.height(), 100, "css change during animateClass was not lost" );
+ start();
+ }
+});
+
+
+$.each( $.effects.effect, function( effect ) {
+ if ( effect === "transfer" ) {
+ return;
+ }
+ module( "effect."+effect );
+ asyncTest( "show/hide", function() {
+ var hidden = $( "div.hidden" );
+ expect( 8 );
+
+ var count = 0,
+ test = 0;
+
+ function queueTest( fn ) {
+ count++;
+ var point = count;
+ return function( next ) {
+ test++;
+ equal( point, test, "Queue function fired in order" );
+ if ( fn ) {
+ fn();
+ } else {
+ setTimeout( next, minDuration );
+ }
+ };
+ }
+
+ hidden.queue( queueTest() ).show( effect, minDuration, queueTest(function() {
+ equal( hidden.css("display"), "block", "Hidden is shown after .show(\"" +effect+ "\", time)" );
+ })).queue( queueTest() ).hide( effect, minDuration, queueTest(function() {
+ equal( hidden.css("display"), "none", "Back to hidden after .hide(\"" +effect+ "\", time)" );
+ })).queue( queueTest(function(next) {
+ deepEqual( hidden.queue(), ["inprogress"], "Only the inprogress sentinel remains");
+ start();
+ }));
+ });
+
+ asyncTest( "relative width & height - properties are preserved", function() {
+ var test = $("div.relWidth.relHeight"),
+ width = test.width(), height = test.height(),
+ cssWidth = test[0].style.width, cssHeight = test[0].style.height;
+
+ expect( 4 );
+ test.toggle( effect, minDuration, function() {
+ equal( test[0].style.width, cssWidth, "Inline CSS Width has been reset after animation ended" );
+ equal( test[0].style.height, cssHeight, "Inline CSS Height has been rest after animation ended" );
+ start();
+ });
+ equal( test.width(), width, "Width is the same px after animation started" );
+ equal( test.height(), height, "Height is the same px after animation started" );
+ });
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js
new file mode 100644
index 0000000..b9bb91c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js
@@ -0,0 +1,68 @@
+(function( $ ) {
+module( "effect.scale: Scale" );
+
+function run( position, v, h, vo, ho ) {
+ var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")";
+ asyncTest( desc, function() {
+ var test = $( ".testScale" ),
+ css = {
+ position: position
+ },
+ effect = {
+ effect: "scale",
+ mode: "effect",
+ percent: 200,
+ origin: [ vo, ho ],
+ complete: complete,
+ duration: 1
+ },
+ target = {},
+ relative = position === "relative";
+
+ css[ h ] = 33;
+ css[ v ] = 33;
+ target[ h ] = h === ho ? css[ h ] : ho == "center" ? css[ h ] - 35 : css[ h ] - 70;
+ target[ v ] = v === vo ? css[ v ] : vo == "middle" ? css[ v ] - 35 : css[ v ] - 70;
+ if ( relative && h == "right" ) {
+ target[ h ] += 70;
+ }
+ if ( relative && v == "bottom" ) {
+ target[ v ] += 70;
+ }
+ test.css( css );
+ test.effect( effect );
+
+ function complete() {
+ equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc );
+ equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc );
+ start();
+ }
+ });
+}
+
+function suite( position ) {
+ run( position, "top", "left", "top", "left" );
+ run( position, "top", "left", "middle", "center" );
+ run( position, "top", "left", "bottom", "right" );
+ /* Firefox is currently not capable of supporting detection of bottom and right....
+ run( position, "bottom", "right", "top", "left" );
+ run( position, "bottom", "right", "middle", "center" );
+ run( position, "bottom", "right", "bottom", "right" );
+ */
+}
+
+$(function() {
+ suite( "absolute" );
+ suite( "relative" );
+ var fixed = $.support.fixedPosition;
+ // jQuery < 1.7 uses $.offset.supportsFixedPosition
+ if ( fixed === undefined ) {
+ $.offset.initialize();
+ fixed = $.offset.supportsFixedPosition;
+ }
+ if ( fixed ) {
+ suite( "fixed" );
+ }
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png b/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png
new file mode 100644
index 0000000..e003d16
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png
Binary files differ
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html
new file mode 100644
index 0000000..b73ede2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html
@@ -0,0 +1,96 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Unit Tests</title>
+
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.core.css">
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.theme.css">
+ <style>
+ body {
+ font-size: 62.5%;
+ }
+ .ui-widget-header {
+ padding: 0.2em 0.5em;
+ margin: 0;
+ }
+ .ui-widget-content {
+ padding: 1em;
+ margin-bottom: 1em;
+ }
+ ul {
+ margin: 0;
+ list-style: none;
+ }
+ li {
+ line-height: 2em;
+ }
+ </style>
+
+ <script src="../jquery.js"></script>
+ <script>
+ $(function() {
+ $( "#main" )
+ .addClass( "ui-widget" )
+ .find( "h1, h2" )
+ .addClass( "ui-widget-header ui-corner-top" )
+ .next()
+ .addClass( "ui-widget-content ui-corner-bottom" );
+
+ });
+ </script>
+</head>
+<body>
+
+<div id="main">
+ <h1>jQuery UI Unit Tests</h1>
+ <div>
+ <h2>Full Test Suite</h2>
+ <ul>
+ <li><a href="all.html">All</a></li>
+ </ul>
+
+ <h2>Core</h2>
+ <ul>
+ <li><a href="core/core.html">Core</a></li>
+ <li><a href="widget/widget.html">Widget</a></li>
+ </ul>
+
+ <h2>Interactions</h2>
+ <ul>
+ <li><a href="draggable/draggable.html">Draggable</a></li>
+ <li><a href="droppable/droppable.html">Droppable</a></li>
+ <li><a href="resizable/resizable.html">Resizable</a></li>
+ <li><a href="selectable/selectable.html">Selectable</a></li>
+ <li><a href="sortable/sortable.html">Sortable</a></li>
+ </ul>
+
+ <h2>Widgets</h2>
+ <ul>
+ <li><a href="accordion/accordion.html">Accordion</a></li>
+ <li><a href="autocomplete/autocomplete.html">Autocomplete</a></li>
+ <li><a href="button/button.html">Button</a></li>
+ <li><a href="datepicker/datepicker.html">Datepicker</a></li>
+ <li><a href="dialog/dialog.html">Dialog</a></li>
+ <li><a href="menu/menu.html">Menu</a></li>
+ <li><a href="progressbar/progressbar.html">Progressbar</a></li>
+ <li><a href="slider/slider.html">Slider</a></li>
+ <li><a href="spinner/spinner.html">Spinner</a></li>
+ <li><a href="tabs/tabs.html">Tabs</a></li>
+ <li><a href="tooltip/tooltip.html">Tooltip</a></li>
+ </ul>
+
+ <h2>Utilities</h2>
+ <ul>
+ <li><a href="position/position.html">Position</a></li>
+ </ul>
+
+ <h2>Effects</h2>
+ <ul>
+ <li><a href="effects/effects.html">Effects</a></li>
+ </ul>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html
new file mode 100644
index 0000000..38b7603
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Menu Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "menu" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Menu Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html
new file mode 100644
index 0000000..76f4a7a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html
@@ -0,0 +1,258 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Menu Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.menu" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.menu.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="menu_test_helpers.js"></script>
+ <script src="menu_core.js"></script>
+ <script src="menu_defaults.js"></script>
+ <script src="menu_events.js"></script>
+ <script src="menu_methods.js"></script>
+ <script src="menu_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+ <style>
+ .ui-menu {
+ font-size: 15px;
+ }
+ #menu3 {
+ height: 250px;
+ overflow: auto;
+ }
+ #menu4, #menu4 ul {
+ height: 250px;
+ overflow: auto;
+ }
+ </style>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Menu Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<ul class="foo" id="menu1">
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+</ul>
+
+<ul id="menu2">
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li>
+ <a href="#">Salzburg</a>
+ <ul>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li class="foo"><a class="foo" href="#">Perch</a></li>
+ </ul>
+ </li>
+</ul>
+
+<ul class="foo" id="menu3">
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo"><a class="foo" href="#">Alexandria</a></li>
+ <li class="foo"><a class="foo" href="#">Alger</a></li>
+ <li class="foo"><a class="foo" href="#">Alledonia</a></li>
+ <li class="foo"><a class="foo" href="#">Alliance</a></li>
+ <li class="foo"><a class="foo" href="#">Alpha</a></li>
+ <li class="foo"><a class="foo" href="#">Alvada</a></li>
+ <li class="foo"><a class="foo" href="#">Alvordton</a></li>
+ <li class="foo"><a class="foo" href="#">Amanda</a></li>
+ <li class="foo"><a class="foo" href="#">Amelia</a></li>
+ <li class="foo"><a class="foo" href="#">Amesville</a></li>
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo"><a class="foo" href="#">Alexandria</a></li>
+ <li class="foo"><a class="foo" href="#">Alger</a></li>
+ <li class="foo"><a class="foo" href="#">Alledonia</a></li>
+ <li class="foo"><a class="foo" href="#">Alliance</a></li>
+ <li class="foo"><a class="foo" href="#">Alpha</a></li>
+ <li class="foo"><a class="foo" href="#">Alvada</a></li>
+ <li class="foo"><a class="foo" href="#">Alvordton</a></li>
+ <li class="foo"><a class="foo" href="#">Amanda</a></li>
+ <li class="foo"><a class="foo" href="#">Amelia</a></li>
+ <li class="foo"><a class="foo" href="#">Amesville</a></li>
+</ul>
+
+<ul class="foo" id="menu4">
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo">
+ <a class="foo" href="#">Ada</a>
+ <ul class="foo">
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo"><a class="foo" href="#">Alexandria</a></li>
+ <li class="foo"><a class="foo" href="#">Alger</a></li>
+ <li class="foo"><a class="foo" href="#">Alledonia</a></li>
+ <li class="foo"><a class="foo" href="#">Alliance</a></li>
+ <li class="foo"><a class="foo" href="#">Alpha</a></li>
+ <li class="foo"><a class="foo" href="#">Alvada</a></li>
+ <li class="foo"><a class="foo" href="#">Alvordton</a></li>
+ <li class="foo"><a class="foo" href="#">Amanda</a></li>
+ <li class="foo"><a class="foo" href="#">Amelia</a></li>
+ <li class="foo"><a class="foo" href="#">Amesville</a></li>
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ </ul>
+ </li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo"><a class="foo" href="#">Alexandria</a></li>
+ <li class="foo"><a class="foo" href="#">Alger</a></li>
+ <li class="foo"><a class="foo" href="#">Alledonia</a></li>
+ <li class="foo"><a class="foo" href="#">Alliance</a></li>
+ <li class="foo"><a class="foo" href="#">Alpha</a></li>
+ <li class="foo"><a class="foo" href="#">Alvada</a></li>
+ <li class="foo"><a class="foo" href="#">Alvordton</a></li>
+ <li class="foo"><a class="foo" href="#">Amanda</a></li>
+ <li class="foo"><a class="foo" href="#">Amelia</a></li>
+ <li class="foo"><a class="foo" href="#">Amesville</a></li>
+ <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo"><a class="foo" href="#">Adamsville</a></li>
+ <li class="foo"><a class="foo" href="#">Addyston</a></li>
+ <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo"><a class="foo" href="#">Adena</a></li>
+ <li class="foo"><a class="foo" href="#">Adrian</a></li>
+ <li class="foo"><a class="foo" href="#">Akron</a></li>
+ <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo"><a class="foo" href="#">Alexandria</a></li>
+ <li class="foo"><a class="foo" href="#">Alger</a></li>
+ <li class="foo"><a class="foo" href="#">Alledonia</a></li>
+ <li class="foo"><a class="foo" href="#">Alliance</a></li>
+ <li class="foo"><a class="foo" href="#">Alpha</a></li>
+ <li class="foo"><a class="foo" href="#">Alvada</a></li>
+ <li class="foo"><a class="foo" href="#">Alvordton</a></li>
+ <li class="foo"><a class="foo" href="#">Amanda</a></li>
+ <li class="foo"><a class="foo" href="#">Amelia</a></li>
+ <li class="foo"><a class="foo" href="#">Amesville</a></li>
+</ul>
+
+<div id="menu5">
+ <blockquote><a href="#">Aberdeen</a></blockquote>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Adamsville</a></blockquote>
+ <blockquote><a href="#">Addyston</a></blockquote>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote>
+ <a href="#">Salzburg</a>
+ <div>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote><a href="#">Perch</a></blockquote>
+ </div>
+ </blockquote>
+</div>
+
+<div id="log"></div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js
new file mode 100644
index 0000000..c0feae7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js
@@ -0,0 +1,41 @@
+/*
+ * menu_core.js
+ */
+
+
+(function($) {
+
+module("menu: core");
+
+test("accessibility", function () {
+ expect(5);
+ var ac = $('#menu1').menu();
+ var item0 = $("li:eq(0) a");
+
+ ok( ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class");
+ equals( ac.attr("role"), "menu", "main role");
+ ok( !ac.attr("aria-activedescendant"), "aria attribute not yet active");
+
+ var item = ac.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end();
+ ac.menu( "focus", $.Event(), item );
+ equals( ac.attr("aria-activedescendant"), "xid", "aria attribute, id from dom");
+
+ var item = ac.find( "li:last" );
+ ac.menu( "focus", $.Event(), item );
+ equals( ac.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
+});
+
+test("items class and role", function () {
+ var ac = $('#menu1').menu();
+ expect(1 + 5 * $("li",ac).length);
+ ok( ($("li",ac).length > 0 ), "number of menu items");
+ $("li",ac).each(function(item) {
+ ok( $(this).hasClass("ui-menu-item"), "menu item ("+ item + ") class for item");
+ equals( $(this).attr("role"), "presentation", "menu item ("+ item + ") role");
+ equals( $("a", this).attr("role"), "menuitem", "menu item ("+ item + ") role");
+ ok( $("a",this).hasClass("ui-corner-all"), "a element class for menu item ("+ item + ") ");
+ equals( $("a",this).attr("tabindex"), "-1", "a element tabindex for menu item ("+ item + ") ");
+ });
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js
new file mode 100644
index 0000000..a559a3d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js
@@ -0,0 +1,14 @@
+commonWidgetTests( "menu", {
+ defaults: {
+ disabled: false,
+ position: {
+ my: "left top",
+ at: "right top"
+ },
+ items: "ul",
+ trigger: null,
+
+ // callbacks
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js
new file mode 100644
index 0000000..55ec1e2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js
@@ -0,0 +1,431 @@
+/*
+ * menu_events.js
+ */
+(function($) {
+
+module("menu: events");
+
+test("handle click on menu", function() {
+ expect(1);
+ var ac = $('#menu1').menu({
+ select: function(event, ui) {
+ menu_log();
+ }
+ });
+ menu_log("click",true);
+ menu_click($('#menu1'),"1");
+ menu_log("afterclick");
+ menu_click( ac,"2");
+ menu_click($('#menu1'),"3");
+ menu_click( ac,"1");
+ equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
+});
+
+test("handle click on custom item menu", function() {
+ expect(1);
+ var ac = $('#menu5').menu({
+ select: function(event, ui) {
+ menu_log();
+ },
+ items: "div"
+ });
+ menu_log("click",true);
+ menu_click($('#menu5'),"1");
+ menu_log("afterclick");
+ menu_click( ac,"2");
+ menu_click($('#menu5'),"3");
+ menu_click( ac,"1");
+ equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
+});
+
+test( "handle blur: click", function() {
+ expect( 4 );
+ var $menu = $( "#menu1" ).menu({
+ focus: function( event, ui ) {
+ equal( event.originalEvent.type, "click", "focus triggered 'click'" );
+ equal( event.type, "menufocus", "focus event.type is 'menufocus'" );
+
+ },
+ blur: function( event, ui ) {
+ equal( event.originalEvent.type, "click", "blur triggered 'click'" );
+ equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ }
+ });
+
+ $menu.find( "li a:first" ).trigger( "click" );
+ $( "<a>", { id: "remove"} ).appendTo("body").trigger( "click" );
+
+ $("#remove").remove();
+});
+
+test( "handle blur on custom item menu: click", function() {
+ expect( 4 );
+ var $menu = $( "#menu5" ).menu({
+ focus: function( event, ui ) {
+ equal( event.originalEvent.type, "click", "focus triggered 'click'" );
+ equal( event.type, "menufocus", "focus event.type is 'menufocus'" );
+
+ },
+ blur: function( event, ui ) {
+ equal( event.originalEvent.type, "click", "blur triggered 'click'" );
+ equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ },
+ items: "div"
+ });
+
+ menu_click($('#menu5'),"1");
+ $( "<a>", { id: "remove"} ).appendTo("body").trigger( "click" );
+
+ $("#remove").remove();
+});
+
+asyncTest( "handle submenu auto collapse: mouseleave", function() {
+ expect( 4 );
+ var $menu = $( "#menu2" ).menu();
+
+ $menu.find( "li:nth-child(7)" ).trigger( "mouseover" );
+ setTimeout(function() {
+ equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" );
+ $menu.find( "li:nth-child(7) li:first" ).trigger( "mouseover" );
+ setTimeout(function() {
+ equal( $menu.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" );
+ $menu.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" );
+ equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
+ $menu.trigger( "mouseleave" );
+ equal( $menu.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
+ start();
+ }, 400);
+ }, 200);
+});
+
+asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function() {
+ expect( 5 );
+ var $menu = $( "#menu5" ).menu( { items: "div" } );
+
+ $menu.children( ":nth-child(7)" ).trigger( "mouseover" );
+ setTimeout(function() {
+ equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "first submenu expanded" );
+ $menu.children( ":nth-child(7)" ).find( "div:first" ).children( ":first" ).trigger( "mouseover" );
+ setTimeout(function() {
+ equal( $menu.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" );
+ $menu.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" );
+ equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
+
+ $menu.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN });
+ ok( $menu.find( ".ui-state-active" ).is( "#menu5 :nth-child(7) a" ),
+ "down keypress selected an item from the first submenu" );
+
+ $menu.trigger( "mouseleave" );
+ equal( $menu.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
+ start();
+ }, 400);
+ }, 200);
+});
+
+
+test("handle keyboard navigation on menu without scroll and without submenus", function() {
+ expect(12);
+ var element = $('#menu1').menu({
+ select: function(event, ui) {
+ menu_log($(ui.item[0]).text());
+ },
+ focus: function( event, ui ) {
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
+ }
+ });
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+ equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "4,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
+ equals( $("#log").html(), "4,keydown,", "Keydown END");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
+ equals( $("#log").html(), "0,keydown,", "Keydown HOME");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
+});
+
+asyncTest("handle keyboard navigation on menu without scroll and with submenus", function() {
+ expect(14);
+ var element = $('#menu2').menu({
+ select: function(event, ui) {
+ menu_log($(ui.item[0]).text());
+ },
+ focus: function( event, ui ) {
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
+ }
+ });
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+
+ setTimeout( function() {
+ equals( $("#log").html(), "0,4,3,2,1,keydown,", "Keydown RIGHT (open submenu)");
+ }, 50);
+
+ setTimeout( function() {
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "4,keydown,", "Keydown LEFT (close submenu)");
+
+ //re-open submenu
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+
+ setTimeout( function() {
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "2,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
+ equals( $("#log").html(), "2,keydown,", "Keydown END");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
+ equals( $("#log").html(), "0,keydown,", "Keydown HOME");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equals( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+
+ setTimeout( function() {
+ equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equals( $("#log").html(), "Ada,keydown,", "Keydown ENTER (select item)");
+
+ start();
+ }, 200);
+ }, 150);
+ }, 100);
+
+});
+
+test("handle keyboard navigation on menu with scroll and without submenus", function() {
+ expect(14);
+ var element = $('#menu3').menu({
+ select: function(event, ui) {
+ menu_log($(ui.item[0]).text());
+ },
+ focus: function( event, ui ) {
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
+ }
+ });
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+ equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
+ equals( $("#log").html(), "37,keydown,", "Keydown END");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
+ equals( $("#log").html(), "0,keydown,", "Keydown HOME");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
+});
+
+asyncTest("handle keyboard navigation on menu with scroll and with submenus", function() {
+ expect(14);
+ var element = $('#menu4').menu({
+ select: function(event, ui) {
+ menu_log($(ui.item[0]).text());
+ },
+ focus: function( event, ui ) {
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
+ }
+ });
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+
+ setTimeout( function() {
+ equals( $("#log").html(), "0,1,keydown,", "Keydown RIGHT (open submenu)");
+ }, 50);
+
+ setTimeout( function() {
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ equals( $("#log").html(), "1,keydown,", "Keydown LEFT (close submenu)");
+
+ //re-open submenu
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
+
+ setTimeout( function() {
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
+ equals( $("#log").html(), "27,keydown,", "Keydown END");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
+ equals( $("#log").html(), "0,keydown,", "Keydown HOME");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equals( $("#log").html(), "1,keydown,", "Keydown ESCAPE (close submenu)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+
+ setTimeout( function() {
+ equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
+
+ menu_log("keydown",true);
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER (select item)");
+
+ start();
+ }, 200);
+ }, 150);
+ }, 100);
+
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js
new file mode 100644
index 0000000..0ecaf73
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js
@@ -0,0 +1,15 @@
+/*
+ * menu_methods.js
+ */
+(function($) {
+
+module("menu: methods");
+
+test("destroy", function() {
+ domEqual("#menu1", function() {
+ $("#menu1").menu().menu("destroy");
+ });
+});
+
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js
new file mode 100644
index 0000000..03822fd
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js
@@ -0,0 +1,10 @@
+/*
+ * menu_options.js
+ */
+(function($) {
+
+module("menu: options");
+
+
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js
new file mode 100644
index 0000000..e83795e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js
@@ -0,0 +1,14 @@
+function menu_log( message, clear ) {
+ if ( clear ) {
+ $( "#log" ).empty();
+ }
+ if ( message === undefined ) {
+ message = $( "#log" ).data( "lastItem" );
+ }
+ $( "#log" ).prepend( $.trim( message ) + "," );
+}
+
+function menu_click( menu, item ) {
+ $( "#log" ).data( "lastItem", item );
+ menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
+} \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html
new file mode 100644
index 0000000..07676f1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Position Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "position" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Position Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html
new file mode 100644
index 0000000..115adc3
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html
@@ -0,0 +1,75 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Position Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script>
+ $.uiBackCompat = false;
+ </script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ js: [ "ui/jquery.ui.position.js" ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="position_core.js"></script>
+ <script src="position_core_within.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+<div style="position:relative; z-index:2;">
+ <h1 id="qunit-header">jQuery UI Position Test Suite</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests">
+ </ol>
+</div>
+
+<!--
+elements smaller than 10px have a line-height set on them to avoid a bug in IE6
+.height() returns the greater of the height and line-height
+-->
+
+<div id="qunit-fixture" style="top: 0; left: 0; z-index:1">
+ <div id="within-container">
+ <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
+ <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
+ <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div>
+
+ <div style="position: absolute; top: 0px; left: 0px">
+ <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div>
+ </div>
+
+ <div style="position: absolute; top: 200px; left: 100px;">
+ <div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div style="position: absolute; top: 100px; left: 50px;">
+ <div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div>
+ </div>
+ </div>
+
+ <div style="position: absolute; height: 5000px; width: 5000px;"></div>
+
+ <div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;">
+ <div id="fractions-element"></div>
+ </div>
+ </div>
+
+ <div id="bug-5280" style="height: 30px; width: 201px;">
+ <div style="width: 50px; height: 10px;"></div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js
new file mode 100644
index 0000000..ea1baee
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js
@@ -0,0 +1,547 @@
+(function( $ ) {
+
+function scrollTopSupport() {
+ $( window ).scrollTop( 1 );
+ return $( window ).scrollTop() === 1;
+}
+
+module( "position" );
+
+test( "my, at, of", function() {
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 40, left: 40 }, "left top, left top" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 60, left: 40 }, "left top, left bottom" );
+
+ $( "#elx" ).position({
+ my: "left",
+ at: "bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 55, left: 50 }, "left, bottom" );
+
+ $( "#elx" ).position({
+ my: "left foo",
+ at: "bar baz",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 45, left: 50 }, "left foo, bar baz" );
+});
+
+test( "multiple elements", function() {
+ var elements = $( "#el1, #el2" );
+ var result = elements.position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parent",
+ collision: "none"
+ });
+
+ same( result, elements );
+ var expected = { top: 10, left: 4 };
+ elements.each(function() {
+ same( $( this ).offset(), expected );
+ });
+});
+
+test( "positions", function() {
+ var definitions = [];
+ var offsets = {
+ left: 0,
+ center: 3,
+ right: 6,
+ top: 0,
+ bottom: 6
+ };
+ var start = { left: 4, top: 4 };
+ $.each( [ 0, 1 ], function( my ) {
+ $.each( [ "top", "center", "bottom" ], function( vindex, vertical ) {
+ $.each( [ "left", "center", "right" ], function( hindex, horizontal ) {
+ definitions.push({
+ my: my ? horizontal + " " + vertical : "left top",
+ at: !my ? horizontal + " " + vertical : "left top",
+ result: {
+ top: my ? start.top - offsets[ vertical ] : start.top + offsets[ vertical ],
+ left: my ? start.left - offsets[ horizontal ] : start.left + offsets[ horizontal ]
+ }
+ });
+ });
+ });
+ });
+ var el = $( "#el1" );
+ $.each( definitions, function( index, definition ) {
+ el.position({
+ my: definition.my,
+ at: definition.at,
+ of: "#parent",
+ collision: "none"
+ });
+ same( el.offset(), definition.result,
+ "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) );
+ });
+});
+
+test( "of", function() {
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 40, left: 40 }, "selector" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: $( "#parentx"),
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 60, left: 40 }, "jQuery object" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: $( "#parentx" )[ 0 ],
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 40, left: 40 }, "DOM element" );
+
+ $( "#elx" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: document,
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: $( document ).height() - 10,
+ left: $( document ).width() - 10
+ }, "document" );
+
+ $( "#elx" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: $( document ),
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: $( document ).height() - 10,
+ left: $( document ).width() - 10
+ }, "document as jQuery object" );
+
+ $( window ).scrollTop( 0 );
+
+ $( "#elx" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: window,
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: $( window ).height() - 10,
+ left: $( window ).width() - 10
+ }, "window" );
+
+ $( "#elx" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: $( window ),
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: $( window ).height() - 10,
+ left: $( window ).width() - 10
+ }, "window as jQuery object" );
+
+ if ( scrollTopSupport() ) {
+ $( window ).scrollTop( 500 ).scrollLeft( 200 );
+ $( "#elx" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: window,
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: $( window ).height() + 500 - 10,
+ left: $( window ).width() + 200 - 10
+ }, "window, scrolled" );
+ $( window ).scrollTop( 0 ).scrollLeft( 0 );
+ }
+
+ var event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } );
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: event,
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: 300,
+ left: 200
+ }, "event - left top, left top" );
+
+ event = $.extend( $.Event( "someEvent" ), { pageX: 400, pageY: 600 } );
+ $( "#elx" ).position({
+ my: "left top",
+ at: "right bottom",
+ of: event,
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), {
+ top: 600,
+ left: 400
+ }, "event - left top, right bottom" );
+});
+
+test( "offsets", function() {
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left+10 bottom+10",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 70, left: 50 }, "offsets in at" );
+
+ $( "#elx" ).position({
+ my: "left+10 top-10",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 50, left: 50 }, "offsets in my" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left+50% bottom-10%",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 58, left: 50 }, "percentage offsets in at" );
+
+ $( "#elx" ).position({
+ my: "left-30% top+50%",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 65, left: 37 }, "percentage offsets in my" );
+});
+
+test( "using", function() {
+ expect( 6 );
+
+ var count = 0,
+ elems = $( "#el1, #el2" ),
+ expectedPosition = { top: 40, left: 40 },
+ originalPosition = elems.position({
+ my: "right bottom",
+ at: "rigt bottom",
+ of: "#parentx",
+ collision: "none"
+ }).offset();
+
+ elems.position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ using: function( position ) {
+ same( this, elems[ count ], "correct context for call #" + count );
+ same( position, expectedPosition, "correct position for call #" + count );
+ count++;
+ }
+ });
+
+ elems.each(function() {
+ same( $( this ).offset(), originalPosition, "elements not moved" );
+ });
+});
+
+function collisionTest( config, result, msg ) {
+ var elem = $( "#elx" ).position( $.extend({
+ my: "left top",
+ at: "right bottom",
+ of: window
+ }, config ) );
+ same( elem.offset(), result, msg );
+}
+
+function collisionTest2( config, result, msg ) {
+ collisionTest( $.extend({
+ my: "right bottom",
+ at: "left top"
+ }, config ), result, msg );
+}
+
+test( "collision: fit, no offset", function() {
+ collisionTest({
+ collision: "fit"
+ }, { top: $( window ).height() - 10, left: $( window ).width() - 10 }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: 0, left: 0 }, "left top" );
+});
+
+test( "collision: fit, with offset", function() {
+ collisionTest({
+ collision: "fit",
+ at: "right+2 bottom+3"
+ }, { top: $(window).height() - 10, left: $(window).width() - 10 }, "right bottom");
+
+ collisionTest2({
+ collision: "fit",
+ at: "left+2 top+3"
+ }, { top: 0, left: 0 }, "left top, positive offset" );
+
+ collisionTest2({
+ collision: "fit",
+ at: "left-2 top-3"
+ }, { top: 0, left: 0 }, "left top, negative offset" );
+});
+
+test( "collision: fit, window scrolled", function() {
+ if ( scrollTopSupport() ) {
+ var win = $( window );
+ win.scrollTop( 300 ).scrollLeft( 200 );
+
+ collisionTest({
+ collision: "fit",
+ at: "left-100 top-100"
+ }, { top: 300, left: 200 }, "top left" );
+ collisionTest2({
+ collision: "fit",
+ at: "right+100 bottom+100"
+ }, { top: 300 + win.height() - 10, left: 200 + win.width() - 10 }, "right bottom" );
+
+ win.scrollTop( 0 ).scrollLeft( 0 );
+ }
+});
+
+test( "collision: flip, no offset", function() {
+ collisionTest({
+ collision: "flip"
+ }, { top: $( window ).height(), left: $( window ).width() }, "left top" );
+
+ collisionTest2({
+ collision: "flip"
+ }, { top: -10, left: -10 }, "right bottom" );
+});
+
+test( "collision: flip, with offset", function() {
+ collisionTest({
+ collision: "flip",
+ at: "right+2 bottom+3"
+ }, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "left top, with offset added" );
+
+ collisionTest2({
+ collision: "flip",
+ at: "left+2 top+3"
+ }, { top: -7, left: -8 }, "bottom, positive offset" );
+
+ collisionTest2({
+ collision: "flip",
+ at: "left-2 top-3"
+ }, { top: -13, left: -12 }, "right bottom, negative offset" );
+});
+
+test( "collision: none, no offset", function() {
+ collisionTest({
+ collision: "none"
+ }, { top: $( window ).height(), left: $( window ).width() }, "left top" );
+
+ collisionTest2({
+ collision: "none"
+ }, { top: -10, left: -10 }, "moved to the right bottom" );
+});
+
+test( "collision: none, with offset", function() {
+ collisionTest({
+ collision: "none",
+ at: "right+2 bottom+3"
+ }, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "right bottom, with offset added" );
+
+ collisionTest2({
+ collision: "none",
+ at: "left+2 top+3"
+ }, { top: -7, left: -8 }, "left top, positive offset" );
+
+ collisionTest2({
+ collision: "none",
+ at: "left-2 top-3"
+ }, { top: -13, left: -12 }, "left top, negative offset" );
+});
+
+test( "collision: fit, with margin", function() {
+ $( "#elx" ).css( "margin", 10 );
+
+ collisionTest({
+ collision: "fit"
+ }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: 10, left: 10 }, "left top" );
+
+ $( "#elx" ).css({
+ "margin-left": 5,
+ "margin-top": 5
+ });
+
+ collisionTest({
+ collision: "fit"
+ }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: 5, left: 5 }, "left top" );
+
+ $( "#elx" ).css({
+ "margin-right": 15,
+ "margin-bottom": 15
+ });
+
+ collisionTest({
+ collision: "fit"
+ }, { top: $( window ).height() - 25, left: $( window ).width() - 25 }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: 5, left: 5 }, "left top" );
+});
+
+test( "collision: flip, with margin", function() {
+ $( "#elx" ).css( "margin", 10 );
+
+ collisionTest({
+ collision: "flip",
+ at: "left top"
+ }, { top: 0, left: 0 }, "left top" );
+
+ collisionTest2({
+ collision: "flip",
+ at: "right bottom"
+ }, { top: $( window ).height() - 10, left: $( window ).width() - 10 }, "right bottom" );
+});
+
+test( "addClass: flipped left", function() {
+ var elem = $( "#elx" ).position( {
+ my: "left center",
+ of: window,
+ collision: "flip",
+ at: "right center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-left' ), false, 'Has ui-flipped-left class' );
+
+ elem.position( {
+ my: "right center",
+ of: window,
+ collision: "flip",
+ at: "left center"
+ })
+
+ same( elem.hasClass( 'ui-flipped-left' ), false, 'Removed ui-flipped-left class' );
+});
+
+test( "addClass: flipped top", function() {
+ var elem = $( "#elx" ).position( {
+ my: "left top",
+ of: window,
+ collision: "flip",
+ at: "right bottom"
+ });
+
+ same( elem.hasClass( 'ui-flipped-top' ), false, 'Has ui-flipped-top class' );
+
+ elem.position( {
+ my: "left bottom",
+ of: window,
+ collision: "flip",
+ at: "right top"
+ });
+
+ same( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' );
+});
+
+test( "addClass: flipped right", function() {
+ var elem = $( "#elx" ).position( {
+ my: "right center",
+ of: window,
+ collision: "flip",
+ at: "left center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-right' ), false, 'Has ui-flipped-right class' );
+
+ elem.position( {
+ my: "left center",
+ of: window,
+ collision: "flip",
+ at: "right center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' );
+
+});
+
+test( "addClass: flipped bottom", function() {
+ var elem = $( "#elx" ).position( {
+ my: "left bottom",
+ of: window,
+ collision: "flip",
+ at: "right top"
+ });
+
+ same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' );
+
+ elem.position( {
+ my: "left top",
+ of: window,
+ collision: "flip",
+ at: "right bottom"
+ });
+
+ same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' );
+});
+
+test( "fractions", function() {
+ $( "#fractions-element" ).position({
+ my: "left top",
+ at: "left top",
+ of: "#fractions-parent",
+ collision: "none"
+ });
+ same( $( "#fractions-element" ).offset(), $( "#fractions-parent" ).offset(), "left top, left top" );
+});
+
+test( "bug #5280: consistent results (avoid fractional values)", function() {
+ var wrapper = $( "#bug-5280" ),
+ elem = wrapper.children(),
+ offset1 = elem.position({
+ my: "center",
+ at: "center",
+ of: wrapper,
+ collision: "none"
+ }).offset(),
+ offset2 = elem.position({
+ my: "center",
+ at: "center",
+ of: wrapper,
+ collision: "none"
+ }).offset();
+ same( offset1, offset2 );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js
new file mode 100644
index 0000000..392e409
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js
@@ -0,0 +1,545 @@
+(function( $ ) {
+
+function scrollTopSupport() {
+ $( window ).scrollTop( 1 );
+ return $( window ).scrollTop() === 1;
+}
+
+module( "position - within", {
+ setup: function(){
+ $("#within-container").css({"width": "70px", "height": "70px", "top": "20px", "left": "20px", "position": "relative"}).show();
+ }
+});
+
+var addTop = -20,
+ addLeft = -20;
+
+$.fn.addOffsets = function() {
+ var elOffset = this.offset(),
+ offset = $("#within-container").offset();
+
+ elOffset.top -= offset.top;
+ elOffset.left -= offset.left;
+
+ return {top: elOffset.top - offset.top, left: elOffset.left - offset.left };
+};
+
+test( "my, at, of", function() {
+ var within = $("#within-container");
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "left top, left top" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 60, left: addLeft + 40 }, "left top, left bottom" );
+
+ $( "#elx" ).position({
+ my: "left",
+ at: "bottom",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 55, left: addLeft + 50 }, "left, bottom" );
+
+ $( "#elx" ).position({
+ my: "left foo",
+ at: "bar baz",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 45, left: addLeft +50 }, "left foo, bar baz" );
+});
+
+test( "multiple elements", function() {
+ var elements = $( "#el1, #el2" );
+ var result = elements.position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parent",
+ collision: "none",
+ within: $("#within-container")
+ });
+
+ same( result, elements );
+ var expected = { top: addTop + 10, left: addLeft + 4 };
+ elements.each(function() {
+ same( $( this ).addOffsets(), expected );
+ });
+});
+
+test( "positions", function() {
+ var definitions = [];
+ var offsets = {
+ left: 0,
+ center: 3,
+ right: 6,
+ top: 0,
+ bottom: 6
+ };
+ var start = { left: 4, top: 4 };
+ $.each( [ 0, 1 ], function( my ) {
+ $.each( [ "top", "center", "bottom" ], function( vindex, vertical ) {
+ $.each( [ "left", "center", "right" ], function( hindex, horizontal ) {
+ definitions.push({
+ my: my ? horizontal + " " + vertical : "left top",
+ at: !my ? horizontal + " " + vertical : "left top",
+ result: {
+ top: addTop + (my ? start.top - offsets[ vertical ] : start.top + offsets[ vertical ]),
+ left: addLeft + (my ? start.left - offsets[ horizontal ] : start.left + offsets[ horizontal ])
+ }
+ });
+ });
+ });
+ });
+ var el = $( "#el1" );
+ $.each( definitions, function( index, definition ) {
+ el.position({
+ my: definition.my,
+ at: definition.at,
+ of: "#parent",
+ collision: "none",
+ within: $("#within-container")
+ });
+ same( el.addOffsets(), definition.result,
+ "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) );
+ });
+});
+
+test( "of", function() {
+ var within = $("#within-container");
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "selector" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: $( "#parentx"),
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 60, left: addLeft + 40 }, "jQuery object" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: $( "#parentx" )[ 0 ],
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "DOM element" );
+
+ var event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } );
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left top",
+ of: event,
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).offset(), {
+ top: 300,
+ left: 200
+ }, "event - left top, left top" );
+
+ event = $.extend( $.Event( "someEvent" ), { pageX: 400, pageY: 600 } );
+ $( "#elx" ).position({
+ my: "left top",
+ at: "right bottom",
+ of: event,
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).offset(), {
+ top: 600,
+ left: 400
+ }, "event - left top, right bottom" );
+});
+
+test( "within:offsets", function() {
+ var within = $("#within-container");
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left+10 bottom+10",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 70, left: addLeft + 50 }, "offsets in at" );
+
+ $( "#elx" ).position({
+ my: "left+10 top-10",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 50, left: addLeft + 50 }, "offsets in my" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left+50% bottom-10%",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 58, left: addLeft + 50 }, "percentage offsets in at" );
+
+ $( "#elx" ).position({
+ my: "left-30% top+50%",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ });
+ same( $( "#elx" ).addOffsets(), { top: addTop + 65, left: addLeft + 37 }, "percentage offsets in my" );
+});
+
+test( "using", function() {
+ expect( 6 );
+
+ var within = $("#within-container");
+
+ var count = 0,
+ elems = $( "#el1, #el2" ),
+ expectedPosition = { top: addTop + 40, left: addLeft + 40 },
+ originalPosition = elems.position({
+ my: "right bottom",
+ at: "right bottom",
+ of: "#parentx",
+ collision: "none",
+ within: within
+ }).addOffsets();
+
+ elems.position({
+ my: "left top",
+ at: "left top",
+ of: "#parentx",
+ using: function( position ) {
+ position.top -= within.offset().top;
+ position.left -= within.offset().left;
+ same( this, elems[ count ], "correct context for call #" + count );
+ same( position, expectedPosition, "correct position for call #" + count );
+ count++;
+ },
+ within: within
+ });
+
+ elems.each(function() {
+ same( $( this ).addOffsets(), originalPosition, "elements not moved" );
+ });
+});
+
+function collisionTest( config, result, msg ) {
+ var within = $("#within-container");
+
+ var elem = $( "#elx" ).position( $.extend({
+ my: "left top",
+ at: "right bottom",
+ of: "#parentx",
+ within: within
+ }, config ) );
+
+ same( elem.addOffsets(), result, msg );
+}
+
+function collisionTest2( config, result, msg ) {
+ collisionTest( $.extend({
+ my: "right bottom",
+ at: "left top"
+ }, config ), result, msg );
+}
+
+test( "collision: fit, no offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "fit"
+ }, { top: addTop + of.position().top + of.height() - $.position.getScrollInfo( within ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( within ).width }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" );
+});
+
+
+test( "collision: fit, with offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "fit",
+ at: "right+2 bottom+3"
+ }, { top: addTop + of.position().top + of.height() - $.position.getScrollInfo( within ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( within ).width }, "right bottom");
+
+ collisionTest2({
+ collision: "fit",
+ at: "left+2 top+3"
+ }, { top: addTop + of.position().top - 7, left: addLeft + of.position().left - 8 }, "left top, positive offset" );
+
+ collisionTest2({
+ collision: "fit",
+ at: "left-2 top-3"
+ }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "left top, negative offset" );
+});
+
+test( "collision: none, within scrolled", function() {
+ if ( scrollTopSupport() ) {
+ var within = $("#within-container").css({"width": "1000px", "height": "800px", "overflow": "auto"}),
+ of = $("#parentx");
+ within.scrollTop( 300 ).scrollLeft( 150 );
+
+ collisionTest({
+ collision: "none",
+ at: "left-100 top-100"
+ }, { top: of.offset().top + addTop - 100 - of.height(), left: of.offset().left + addLeft - 100 - of.width() }, "top left" );
+ collisionTest2({
+ collision: "none",
+ at: "right+100 bottom+100"
+ }, { top: of.offset().top + addTop + 100 - 10, left: of.offset().left + addLeft + 100 - 10 }, "right bottom" );
+ within.scrollTop( 0 ).scrollLeft( 0 );
+ }
+});
+
+test( "collision: flip, no offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "flip"
+ }, { top: addTop + of.position().top + of.height(), left: addLeft + of.position().left + of.width() }, "left top" );
+
+ collisionTest2({
+ collision: "flip"
+ }, { top: addTop + of.position().top - 10, left: addTop + of.position().top - 10 }, "right bottom" );
+});
+
+test( "collision: flip, with offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "flip",
+ at: "right+2 bottom+3"
+ }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "left top, with offset added" );
+
+ collisionTest2({
+ collision: "flip",
+ at: "left+2 top+3"
+ }, { top: addTop + of.position().top - 10 + 3, left: addLeft + of.position().left - 10 + 2 }, "right bottom, positive offset" );
+
+ collisionTest2({
+ collision: "flip",
+ at: "left-2 top-3"
+ }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "right bottom, negative offset" );
+});
+
+test( "collision: none, no offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "none"
+ }, { top: addTop + of.position().top + of.height(), left: addLeft + of.position().left + of.width() }, "left top" );
+
+ collisionTest2({
+ collision: "none"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "right bottom" );
+});
+
+test( "collision: none, with offset", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ collisionTest({
+ collision: "none",
+ at: "right+2 bottom+3"
+ }, { top: addTop + of.position().top + of.height() + 3, left: addLeft + of.position().left + of.width() + 2 }, "right bottom, with offset added" );
+
+ collisionTest2({
+ collision: "none",
+ at: "left+2 top+3"
+ }, { top: addTop + of.position().top - 7, left: addTop + of.position().top - 8 }, "left top, positive offset" );
+
+ collisionTest2({
+ collision: "none",
+ at: "left-2 top-3"
+ }, { top: addTop + of.position().top - 13, left: addTop + of.position().top - 12 }, "left top, negative offset" );
+});
+
+test( "collision: fit, with margin", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ $( "#elx" ).css( "margin", 10 );
+
+ collisionTest({
+ collision: "fit"
+ }, { top: addTop + of.position().top + of.height() - 10 - $.position.getScrollInfo( within ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( within ).width }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" );
+
+ $( "#elx" ).css({
+ "margin-left": 5,
+ "margin-top": 5
+ });
+
+ collisionTest({
+ collision: "fit"
+ }, { top: addTop + of.position().top + of.height() - 10 - $.position.getScrollInfo( within ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( within ).width }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" );
+
+ $( "#elx" ).css({
+ "margin-right": 15,
+ "margin-bottom": 15
+ });
+
+ collisionTest({
+ collision: "fit"
+ }, { top: addTop + of.position().top + of.height() - 15 - $.position.getScrollInfo( within ).height, left: addLeft + of.position().left + of.width() - 15 - $.position.getScrollInfo( within ).width }, "right bottom" );
+
+ collisionTest2({
+ collision: "fit"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" );
+});
+
+test( "collision: flip, with margin", function() {
+ var within = $("#within-container"),
+ of = $("#parentx");
+
+ $( "#elx" ).css( "margin", 10 );
+
+ collisionTest({
+ collision: "flip"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" );
+
+ collisionTest2({
+ collision: "flip"
+ }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "right bottom" );
+
+ $( "#elx" ).css( "margin", 0 );
+});
+
+test( "addClass: flipped left", function() {
+ var within = $("#within-container");
+
+ var elem = $( "#elx" ).position( {
+ my: "left center",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "right center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-left' ), false, 'Has ui-flipped-left class' );
+
+ elem.position( {
+ my: "right center",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "left center"
+ })
+
+ same( elem.hasClass( 'ui-flipped-left' ), false, 'Removed ui-flipped-left class' );
+});
+
+test( "addClass: flipped top", function() {
+ var within = $("#within-container");
+
+ var elem = $( "#elx" ).position( {
+ my: "left top",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "right bottom"
+ });
+
+ same( elem.hasClass( 'ui-flipped-top' ), false, 'Has ui-flipped-top class' );
+
+ elem.position( {
+ my: "left bottom",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "right top"
+ });
+
+ same( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' );
+});
+
+test( "addClass: flipped right", function() {
+ var within = $("#within-container");
+
+ var elem = $( "#elx" ).position( {
+ my: "right center",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "left center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-right' ), false, 'Has ui-flipped-right class' );
+
+ elem.position( {
+ my: "left center",
+ of: within[0],
+ within: within,
+ collision: "flip",
+ at: "right center"
+ });
+
+ same( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' );
+
+});
+
+test( "addClass: flipped bottom", function() {
+ var within = $("#within-container");
+
+ var elem = $( "#elx" ).position( {
+ my: "left bottom",
+ of: window,
+ collision: "flip",
+ at: "right top"
+ });
+
+ same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' );
+
+ elem.position( {
+ my: "left top",
+ of: window,
+ collision: "flip",
+ at: "right bottom"
+ });
+
+ same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html
new file mode 100644
index 0000000..ee9be18
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html
@@ -0,0 +1,68 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Position Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ js: [ "ui/jquery.ui.position.js" ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="position_core.js"></script>
+ <script src="position_deprecated.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Position Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<!--
+elements smaller than 10px have a line-height set on them to avoid a bug in IE6
+.height() returns the greater of the height and line-height
+-->
+
+<div id="qunit-fixture" style="top: 0; left: 0;">
+ <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
+ <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
+ <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div>
+</div>
+
+<div style="position: absolute; top: 0px; left: 0px">
+ <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div>
+</div>
+
+<div style="position: absolute; top: 200px; left: 100px;">
+ <div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div style="position: absolute; top: 100px; left: 50px;">
+ <div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
+ <div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div>
+ </div>
+</div>
+
+<div style="position: absolute; height: 5000px; width: 5000px;"></div>
+
+<div id="bug-5280" style="height: 30px; width: 201px;">
+ <div style="width: 50px; height: 10px;"></div>
+</div>
+
+<div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;">
+ <div id="fractions-element"></div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js
new file mode 100644
index 0000000..3e72c4a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js
@@ -0,0 +1,32 @@
+(function( $ ) {
+
+test( "offset", function() {
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parentx",
+ offset: "10",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parentx",
+ offset: "5 -3",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" );
+
+ $( "#elx" ).position({
+ my: "left top",
+ at: "left bottom",
+ of: "#parentx",
+ offset: "5px -3px",
+ collision: "none"
+ });
+ same( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html
new file mode 100644
index 0000000..52c1950
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Progressbar Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "progressbar" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Progressbar Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html
new file mode 100644
index 0000000..8b55f5a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Progressbar Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.progressbar" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.progressbar.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="progressbar_core.js"></script>
+ <script src="progressbar_defaults.js"></script>
+ <script src="progressbar_events.js"></script>
+ <script src="progressbar_methods.js"></script>
+ <script src="progressbar_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Progressbar Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="progressbar"></div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js
new file mode 100644
index 0000000..a499d85
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js
@@ -0,0 +1,28 @@
+/*
+ * progressbar_core.js
+ */
+
+var el;
+
+(function($) {
+
+module("progressbar: core");
+
+test("accessibility", function() {
+ expect(7);
+ el = $("#progressbar").progressbar();
+
+ equals(el.attr("role"), "progressbar", "aria role");
+ equals(el.attr("aria-valuemin"), 0, "aria-valuemin");
+ equals(el.attr("aria-valuemax"), 100, "aria-valuemax");
+ equals(el.attr("aria-valuenow"), 0, "aria-valuenow initially");
+ el.progressbar("value", 77);
+ equals(el.attr("aria-valuenow"), 77, "aria-valuenow");
+ el.progressbar("disable");
+ equals(el.attr("aria-disabled"), "true", "aria-disabled on");
+ el.progressbar("enable");
+ // FAIL: for some reason IE6 and 7 return a boolean false instead of the string
+ equals(el.attr("aria-disabled"), "false", "aria-disabled off");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js
new file mode 100644
index 0000000..3856e31
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js
@@ -0,0 +1,10 @@
+commonWidgetTests( "progressbar", {
+ defaults: {
+ disabled: false,
+ value: 0,
+ max: 100,
+
+ //callbacks
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js
new file mode 100644
index 0000000..585c090
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js
@@ -0,0 +1,51 @@
+/*
+ * progressbar_events.js
+ */
+(function($) {
+
+module("progressbar: events");
+
+test("create", function() {
+ expect(1);
+ $("#progressbar").progressbar({
+ value: 5,
+ create: function() {
+ same(5, $(this).progressbar("value") );
+ },
+ change: function() {
+ ok(false, 'create() has triggered change()');
+ }
+ })
+});
+
+test("change", function() {
+ expect(1);
+ $("#progressbar").progressbar({
+ change: function() {
+ same( 5, $(this).progressbar("value") );
+ }
+ }).progressbar("value", 5);
+});
+
+test( "complete", function() {
+ expect( 3 );
+ var changes = 0,
+ value;
+
+ $( "#progressbar" ).progressbar({
+ change: function() {
+ changes++;
+ same( $( this ).progressbar( "value" ), value, "change at " + value );
+ },
+ complete: function() {
+ equal( changes, 2, "complete triggered after change" );
+ }
+ });
+
+ value = 5;
+ $( "#progressbar" ).progressbar( "value", value );
+ value = 100;
+ $( "#progressbar" ).progressbar( "value", value );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js
new file mode 100644
index 0000000..a48fa3d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js
@@ -0,0 +1,36 @@
+/*
+ * progressbar_methods.js
+ */
+(function($) {
+
+module("progressbar: methods");
+
+test("init", function() {
+ expect(1);
+
+ $("<div></div>").appendTo('body').progressbar().remove();
+ ok(true, '.progressbar() called on element');
+
+});
+
+test("destroy", function() {
+ expect(2);
+
+ $("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
+ ok(true, '.progressbar("destroy") called on element');
+
+ var expected = $('<div></div>').progressbar(),
+ actual = expected.progressbar('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test('value', function() {
+ expect(3);
+
+ var el = $('<div></div>').progressbar({ value: 20 });
+ equals(el.progressbar('value'), 20, 'correct value as getter');
+ equals(el.progressbar('value', 30), el, 'chainable as setter');
+ equals(el.progressbar('option', 'value'), 30, 'correct value after setter');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js
new file mode 100644
index 0000000..230c939
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js
@@ -0,0 +1,59 @@
+/*
+ * progressbar_options.js
+ */
+(function($) {
+
+module("progressbar: options");
+
+test("{ value : 0 }, default", function() {
+ $("#progressbar").progressbar();
+ same( 0, $("#progressbar").progressbar("value") );
+});
+
+// Ticket #7231 - valueDiv should be hidden when value is at 0%
+test( "value: visibility of valueDiv", function() {
+ expect( 5 );
+ var element = $( "#progressbar" ).progressbar({
+ value: 0
+ });
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is initialized at 0" );
+ element.progressbar( "value", 1 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 1" );
+ element.progressbar( "value", 100 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 100" );
+ element.progressbar( "value", 0 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is set to 0" );
+ element.progressbar( "value", -1 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value set to -1 (normalizes to 0)" );
+});
+
+test("{ value : 5 }", function() {
+ $("#progressbar").progressbar({
+ value: 5
+ });
+ same( 5, $("#progressbar").progressbar("value") );
+});
+
+test("{ value : -5 }", function() {
+ $("#progressbar").progressbar({
+ value: -5
+ });
+ same( 0, $("#progressbar").progressbar("value") );
+});
+
+test("{ value : 105 }", function() {
+ $("#progressbar").progressbar({
+ value: 105
+ });
+ same( 100, $("#progressbar").progressbar("value") );
+});
+
+test("{ max : 5, value : 10 }", function() {
+ $("#progressbar").progressbar({
+ max: 5,
+ value: 10
+ });
+ same( 5, $("#progressbar").progressbar("value") );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html
new file mode 100644
index 0000000..2f56d02
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Resizable Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "resizable" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Resizable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg
new file mode 100644
index 0000000..0175b13
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg
Binary files differ
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html
new file mode 100644
index 0000000..4e886d2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html
@@ -0,0 +1,58 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Resizable Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.resizable" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.resizable.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="resizable_core.js"></script>
+ <script src="resizable_defaults.js"></script>
+ <script src="resizable_events.js"></script>
+ <script src="resizable_methods.js"></script>
+ <script src="resizable_options.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("resizable", function() { ok(true, "disabled resizable testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Resizable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div>
+<img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js
new file mode 100644
index 0000000..33a3f72
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js
@@ -0,0 +1,148 @@
+/*
+ * resizable_core.js
+ */
+
+var el;
+
+var drag = function(el, dx, dy, complete) {
+
+ // speed = sync -> Drag syncrhonously.
+ // speed = fast|slow -> Drag asyncrhonously - animated.
+
+ //this mouseover is to work around a limitation in resizable
+ //TODO: fix resizable so handle doesn't require mouseover in order to be used
+ $(el).simulate("mouseover");
+
+ return $(el).simulate("drag", {
+ dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
+ });
+};
+
+(function($) {
+
+module("resizable: core");
+
+/*
+test("element types", function() {
+ var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
+ + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
+ + ',acronym,code,samp,kbd,var,img,object,hr'
+ + ',input,button,label,select,iframe').split(',');
+
+ $.each(typeNames, function(i) {
+ var typeName = typeNames[i];
+ el = $(document.createElement(typeName)).appendTo('body');
+ (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
+ el.resizable();
+ ok(true, '$("&lt;' + typeName + '/&gt").resizable()');
+ el.resizable("destroy");
+ el.remove();
+ });
+});
+*/
+
+test("n", function() {
+ expect(2);
+
+ var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, 0, -50);
+ equals( target.height(), 150, "compare height" );
+
+ drag(handle, 0, 50);
+ equals( target.height(), 100, "compare height" );
+});
+
+test("s", function() {
+ expect(2);
+
+ var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, 0, 50);
+ equals( target.height(), 150, "compare height" );
+
+ drag(handle, 0, -50);
+ equals( target.height(), 100, "compare height" );
+});
+
+test("e", function() {
+ expect(2);
+
+ var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, 50);
+ equals( target.width(), 150, "compare width");
+
+ drag(handle, -50);
+ equals( target.width(), 100, "compare width" );
+});
+
+test("w", function() {
+ expect(2);
+
+ var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, -50);
+ equals( target.width(), 150, "compare width" );
+
+ drag(handle, 50);
+ equals( target.width(), 100, "compare width" );
+});
+
+test("ne", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });
+
+ drag(handle, -50, -50);
+ equals( target.width(), 50, "compare width" );
+ equals( target.height(), 150, "compare height" );
+
+ drag(handle, 50, 50);
+ equals( target.width(), 100, "compare width" );
+ equals( target.height(), 100, "compare height" );
+});
+
+test("se", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, 50, 50);
+ equals( target.width(), 150, "compare width" );
+ equals( target.height(), 150, "compare height" );
+
+ drag(handle, -50, -50);
+ equals( target.width(), 100, "compare width" );
+ equals( target.height(), 100, "compare height" );
+});
+
+test("sw", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, -50, -50);
+ equals( target.width(), 150, "compare width" );
+ equals( target.height(), 50, "compare height" );
+
+ drag(handle, 50, 50);
+ equals( target.width(), 100, "compare width" );
+ equals( target.height(), 100, "compare height" );
+});
+
+test("nw", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });
+
+ drag(handle, -50, -50);
+ equals( target.width(), 150, "compare width" );
+ equals( target.height(), 150, "compare height" );
+
+ drag(handle, 50, 50);
+ equals( target.width(), 100, "compare width" );
+ equals( target.height(), 100, "compare height" );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js
new file mode 100644
index 0000000..f69e521
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js
@@ -0,0 +1,28 @@
+/*
+ * resizable_defaults.js
+ */
+
+var resizable_defaults = {
+ alsoResize: false,
+ animate: false,
+ animateDuration: 'slow',
+ animateEasing: 'swing',
+ aspectRatio: false,
+ autoHide: false,
+ cancel: ':input,option',
+ containment: false,
+ delay: 0,
+ disabled: false,
+ distance: 1,
+ ghost: false,
+ grid: false,
+ handles: 'e,s,se',
+ helper: false,
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 10,
+ minWidth: 10,
+ zIndex: 1000
+};
+
+commonWidgetTests('resizable', { defaults: resizable_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js
new file mode 100644
index 0000000..e8041f0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js
@@ -0,0 +1,20 @@
+/*
+ * resizable_events.js
+ */
+(function($) {
+
+module("resizable: events");
+
+test("start", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("resize", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("stop", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js
new file mode 100644
index 0000000..6ac287f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js
@@ -0,0 +1,64 @@
+/*
+ * resizable_methods.js
+ */
+(function($) {
+
+module("resizable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').resizable().remove();
+ ok(true, '.resizable() called on element');
+
+ $([]).resizable().remove();
+ ok(true, '.resizable() called on empty collection');
+
+ $('<div></div>').resizable().remove();
+ ok(true, '.resizable() called on disconnected DOMElement');
+
+ $('<div></div>').resizable().resizable("foo").remove();
+ ok(true, 'arbitrary method called after init');
+
+ el = $('<div></div>').resizable()
+ var foo = el.resizable("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').resizable().resizable("option", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on element');
+
+ $([]).resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on empty collection');
+
+ $('<div></div>').resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on disconnected DOMElement');
+
+ $('<div></div>').resizable().resizable("destroy").resizable("foo").remove();
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('enable');
+ equals(actual, expected, 'enable is chainable');
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("disable", function() {
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('disable');
+ equals(actual, expected, 'disable is chainable');
+ ok(false, "missing test - untested code is broken code.");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js
new file mode 100644
index 0000000..389931f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js
@@ -0,0 +1,190 @@
+/*
+ * resizable_options.js
+ */
+(function($) {
+
+module("resizable: options");
+
+test("aspectRatio: 'preserve' (e)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, 80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, -130);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (w)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, -80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, 130);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (n)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, 0, -80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, 0, 80);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (s)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, 0, 80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, 0, -80);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (se)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, 80, 80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, -80, -80);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (sw)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, -80, 80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, 80, -80);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("aspectRatio: 'preserve' (ne)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
+
+ drag(handle, 80, -80);
+ equals( target.width(), 130, "compare maxWidth");
+ equals( target.height(), 130, "compare maxHeight");
+
+ drag(handle, -80, 80);
+ equals( target.width(), 70, "compare minWidth");
+ equals( target.height(), 70, "compare minHeight");
+});
+
+test("grid", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });
+
+ drag(handle, 3, 9);
+ equals( target.width(), 103, "compare width");
+ equals( target.height(), 100, "compare height");
+
+ drag(handle, 15, 11);
+ equals( target.width(), 118, "compare width");
+ equals( target.height(), 120, "compare height");
+});
+
+test("grid (wrapped)", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });
+
+ drag(handle, 3, 9);
+ equals( target.width(), 103, "compare width");
+ equals( target.height(), 100, "compare height");
+
+ drag(handle, 15, 11);
+ equals( target.width(), 118, "compare width");
+ equals( target.height(), 120, "compare height");
+});
+
+test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
+
+ drag(handle, -50, -50);
+ equals( target.width(), 60, "compare minWidth" );
+ equals( target.height(), 60, "compare minHeight" );
+
+ drag(handle, 70, 70);
+ equals( target.width(), 100, "compare maxWidth" );
+ equals( target.height(), 100, "compare maxHeight" );
+});
+
+test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
+
+ drag(handle, 50, -50);
+ equals( target.width(), 60, "compare minWidth" );
+ equals( target.height(), 60, "compare minHeight" );
+
+ drag(handle, -70, 70);
+ equals( target.width(), 100, "compare maxWidth" );
+ equals( target.height(), 100, "compare maxHeight" );
+});
+
+test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
+
+ drag(handle, -50, 50);
+ equals( target.width(), 60, "compare minWidth" );
+ equals( target.height(), 60, "compare minHeight" );
+
+ drag(handle, 70, -70);
+ equals( target.width(), 100, "compare maxWidth" );
+ equals( target.height(), 100, "compare maxHeight" );
+});
+
+test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
+ expect(4);
+
+ var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
+
+ drag(handle, 70, 70);
+ equals( target.width(), 60, "compare minWidth" );
+ equals( target.height(), 60, "compare minHeight" );
+
+ drag(handle, -70, -70);
+ equals( target.width(), 100, "compare maxWidth" );
+ equals( target.height(), 100, "compare maxHeight" );
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html
new file mode 100644
index 0000000..e77829b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Selectable Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "selectable" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Selectable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html
new file mode 100644
index 0000000..4f70e8d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html
@@ -0,0 +1,63 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Selectable Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.selectable" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.selectable.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="selectable_core.js"></script>
+ <script src="selectable_defaults.js"></script>
+ <script src="selectable_events.js"></script>
+ <script src="selectable_methods.js"></script>
+ <script src="selectable_options.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("selectable", function() { ok(true, "disabled selectable testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Selectable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<ul id="selectable1">
+ <li>Item 1</li>
+ <li>Item 2</li>
+ <li class="special">Item 3</li>
+ <li>Item 4</li>
+ <li>Item 5</li>
+</ul>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js
new file mode 100644
index 0000000..18ea3a3
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js
@@ -0,0 +1,16 @@
+/*
+ * selectable_core.js
+ */
+
+var el;
+
+var drag = function(dx, dy) {
+ var off = el.offset(), pos = { clientX: off.left, clientY: off.top };
+ el.simulate("mousedown", pos);
+ $(document).simulate("mousemove", pos);
+ pos.clientX += dx;
+ pos.clientY += dy;
+ $(document).simulate("mousemove", pos);
+ $(document).simulate("mouseup", pos);
+};
+
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js
new file mode 100644
index 0000000..dbf799a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js
@@ -0,0 +1,16 @@
+/*
+ * selectable_defaults.js
+ */
+
+var selectable_defaults = {
+ appendTo: 'body',
+ autoRefresh: true,
+ cancel: ':input,option',
+ delay: 0,
+ disabled: false,
+ distance: 0,
+ filter: '*',
+ tolerance: 'touch'
+};
+
+commonWidgetTests('selectable', { defaults: selectable_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js
new file mode 100644
index 0000000..03b65ab
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js
@@ -0,0 +1,32 @@
+/*
+ * selectable_events.js
+ */
+(function($) {
+
+module("selectable: events");
+
+test("start", function() {
+ expect(2);
+ el = $("#selectable1");
+ el.selectable({
+ start: function(ev, ui) {
+ ok(true, "drag fired start callback");
+ equals(this, el[0], "context of callback");
+ }
+ });
+ el.simulate("drag", 20, 20);
+});
+
+test("stop", function() {
+ expect(2);
+ el = $("#selectable1");
+ el.selectable({
+ start: function(ev, ui) {
+ ok(true, "drag fired stop callback");
+ equals(this, el[0], "context of callback");
+ }
+ });
+ el.simulate("drag", 20, 20);
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js
new file mode 100644
index 0000000..06b75f9
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js
@@ -0,0 +1,93 @@
+/*
+ * selectable_methods.js
+ */
+(function($) {
+
+module("selectable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').selectable().remove();
+ ok(true, '.selectable() called on element');
+
+ $([]).selectable().remove();
+ ok(true, '.selectable() called on empty collection');
+
+ $("<div></div>").selectable().remove();
+ ok(true, '.selectable() called on disconnected DOMElement');
+
+ $("<div></div>").selectable().selectable("foo").remove();
+ ok(true, 'arbitrary method called after init');
+
+ el = $("<div></div>").selectable()
+ var foo = el.selectable("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $("<div></div>").selectable().selectable("option", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').selectable().selectable("destroy").remove();
+ ok(true, '.selectable("destroy") called on element');
+
+ $([]).selectable().selectable("destroy").remove();
+ ok(true, '.selectable("destroy") called on empty collection');
+
+ $("<div></div>").selectable().selectable("destroy").remove();
+ ok(true, '.selectable("destroy") called on disconnected DOMElement');
+
+ $("<div></div>").selectable().selectable("destroy").selectable("foo").remove();
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ expect(3);
+ var fired = false;
+
+ el = $("#selectable1");
+ el.selectable({
+ disabled: true,
+ start: function() { fired = true; }
+ });
+ el.simulate("drag", 20, 20);
+ equals(fired, false, "start fired");
+ el.selectable("enable");
+ el.simulate("drag", 20, 20);
+ equals(fired, true, "start fired");
+ el.selectable("destroy");
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('enable');
+ equals(actual, expected, 'enable is chainable');
+});
+
+test("disable", function() {
+ expect(3);
+ var fired = false;
+
+ el = $("#selectable1");
+ el.selectable({
+ disabled: false,
+ start: function() { fired = true; }
+ });
+ el.simulate("drag", 20, 20);
+ equals(fired, true, "start fired");
+ el.selectable("disable");
+ fired = false;
+ el.simulate("drag", 20, 20);
+ equals(fired, false, "start fired");
+ el.selectable("destroy");
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('disable');
+ equals(actual, expected, 'disable is chainable');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js
new file mode 100644
index 0000000..36b7b5b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js
@@ -0,0 +1,46 @@
+/*
+ * selectable_options.js
+ */
+(function($) {
+
+module("selectable: options");
+
+test("autoRefresh", function() {
+ expect(3);
+ el = $("#selectable1");
+ var actual, sel = $("*", el), selected = function() { actual += 1 };
+
+ actual = 0;
+ el = $("#selectable1").selectable({ autoRefresh: false, selected: selected });
+ sel.hide();
+ drag(1000, 1000);
+ equals(actual, sel.length);
+ el.selectable("destroy");
+
+ actual = 0;
+ sel.show();
+ el = $("#selectable1").selectable({ autoRefresh: true, selected: selected });
+ sel.hide();
+ drag(1000, 1000);
+ equals(actual, 0);
+ sel.show();
+ drag(1000, 1000);
+ equals(actual, sel.length);
+ el.selectable("destroy");
+ sel.show();
+});
+
+test("filter", function() {
+ expect(2);
+ el = $("#selectable1");
+ var actual, sel = $("*", el), selected = function() { actual += 1 };
+
+ actual = 0;
+ el = $("#selectable1").selectable({ filter: '.special', selected: selected });
+ drag(1000, 1000);
+ ok(sel.length != 1, "this test assumes more than 1 selectee");
+ equals(actual, 1);
+ el.selectable("destroy");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html
new file mode 100644
index 0000000..cbdbd2f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Slider Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "slider" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Slider Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html
new file mode 100644
index 0000000..60d124b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Slider Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.slider" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.slider.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="slider_core.js"></script>
+ <script src="slider_defaults.js"></script>
+ <script src="slider_events.js"></script>
+ <script src="slider_methods.js"></script>
+ <script src="slider_options.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("slider", function() { ok(true, "disabled slider testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Slider Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="slider1"></div>
+<div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;">
+ <div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js
new file mode 100644
index 0000000..38d4f46
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js
@@ -0,0 +1,292 @@
+/*
+ * slider unit tests
+ */
+(function($) {
+//
+// Slider Test Helper Functions
+//
+
+var el, options;
+
+function handle() {
+ return el.find(".ui-slider-handle");
+}
+
+// Slider Tests
+module("slider: core");
+
+test("keydown HOME on handle sets value to min", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 0);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME });
+ equals(el.slider("value"), options.min);
+
+ el.slider('destroy');
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 0);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME });
+ equals(el.slider("value"), options.min);
+
+ el.slider('destroy');
+});
+
+test("keydown END on handle sets value to max", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 0);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.END });
+ equals(el.slider("value"), options.max);
+
+ el.slider('destroy');
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 0);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.END });
+ equals(el.slider("value"), options.max);
+
+ el.slider('destroy');
+});
+
+test("keydown PAGE_UP on handle increases value by 1/5 range, not greater than max", function() {
+ $.each(['horizontal', 'vertical'], function(i, orientation) {
+ el = $('<div></div>');
+ options = {
+ max: 100,
+ min: 0,
+ orientation: orientation,
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 70);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP });
+ equals(el.slider("value"), 90);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP });
+ equals(el.slider("value"), 100);
+
+ el.slider("destroy");
+ });
+});
+
+test("keydown PAGE_DOWN on handle decreases value by 1/5 range, not less than min", function() {
+ $.each(['horizontal', 'vertical'], function(i, orientation) {
+ el = $('<div></div>');
+ options = {
+ max: 100,
+ min: 0,
+ orientation: orientation,
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", 30);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN });
+ equals(el.slider("value"), 10);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN });
+ equals(el.slider("value"), 0);
+
+ el.slider("destroy");
+ });
+});
+
+test("keydown UP on handle increases value by step, not greater than max", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.max - options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
+ equals(el.slider("value"), options.max);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
+ equals(el.slider("value"), options.max);
+
+ el.slider("destroy");
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.max - options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
+ equals(el.slider("value"), options.max);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
+ equals(el.slider("value"), options.max);
+
+ el.slider("destroy");
+});
+
+test("keydown RIGHT on handle increases value by step, not greater than max", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.max - options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
+ equals(el.slider("value"), options.max);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
+ equals(el.slider("value"), options.max);
+
+ el.slider("destroy");
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.max - options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
+ equals(el.slider("value"), options.max);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
+ equals(el.slider("value"), options.max);
+
+ el.slider("destroy");
+});
+
+test("keydown DOWN on handle decreases value by step, not less than min", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.min + options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
+ equals(el.slider("value"), options.min);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
+ equals(el.slider("value"), options.min);
+
+ el.slider("destroy");
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.min + options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
+ equals(el.slider("value"), options.min);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
+ equals(el.slider("value"), options.min);
+
+ el.slider("destroy");
+});
+
+test("keydown LEFT on handle decreases value by step, not less than min", function() {
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'horizontal',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.min + options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
+ equals(el.slider("value"), options.min);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
+ equals(el.slider("value"), options.min);
+
+ el.slider("destroy");
+
+ el = $('<div></div>');
+ options = {
+ max: 5,
+ min: -5,
+ orientation: 'vertical',
+ step: 1
+ };
+ el.slider(options);
+
+ el.slider("value", options.min + options.step);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
+ equals(el.slider("value"), options.min);
+
+ handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
+ equals(el.slider("value"), options.min);
+
+ el.slider("destroy");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js
new file mode 100644
index 0000000..8049fe9
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js
@@ -0,0 +1,19 @@
+commonWidgetTests( "slider", {
+ defaults: {
+ animate: false,
+ cancel: ':input,option',
+ delay: 0,
+ disabled: false,
+ distance: 0,
+ max: 100,
+ min: 0,
+ orientation: 'horizontal',
+ range: false,
+ step: 1,
+ value: 0,
+ values: null,
+
+ // callbacks
+ create: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js
new file mode 100644
index 0000000..0b7b250
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js
@@ -0,0 +1,109 @@
+/*
+ * slider_events.js
+ */
+(function($) {
+
+module( "slider: events" );
+
+//Specs from http://wiki.jqueryui.com/Slider#specs
+//"change callback: triggers when the slider has stopped moving and has a new
+// value (even if same as previous value), via mouse(mouseup) or keyboard(keyup)
+// or value method/option"
+test( "mouse based interaction", function() {
+ expect(4);
+
+ var el = $( "<div></div>" )
+ .appendTo( "body" )
+ .slider({
+ start: function(event, ui) {
+ equals( event.originalEvent.type, "mousedown", "start triggered by mousedown" );
+ },
+ slide: function(event, ui) {
+ equals( event.originalEvent.type, "mousemove", "slider triggered by mousemove" );
+ },
+ stop: function(event, ui) {
+ equals( event.originalEvent.type, "mouseup", "stop triggered by mouseup" );
+ },
+ change: function(event, ui) {
+ equals( event.originalEvent.type, "mouseup", "change triggered by mouseup" );
+ }
+ });
+
+ el.find( ".ui-slider-handle" ).eq( 0 )
+ .simulate( "drag", { dx: 10, dy: 10 } );
+
+});
+test( "keyboard based interaction", function() {
+ expect(3);
+
+ // Test keyup at end of handle slide (keyboard)
+ var el = $( "<div></div>" )
+ .appendTo( "body" )
+ .slider({
+ start: function(event, ui) {
+ equals( event.originalEvent.type, "keydown", "start triggered by keydown" );
+ },
+ slide: function(event, ui) {
+ ok( false, "Slider never triggered by keys" );
+ },
+ stop: function(event, ui) {
+ equals( event.originalEvent.type, "keyup", "stop triggered by keyup" );
+ },
+ change: function(event, ui) {
+ equals( event.originalEvent.type, "keyup", "change triggered by keyup" );
+ }
+ });
+
+ el.find( ".ui-slider-handle" ).eq( 0 )
+ .simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } )
+ .simulate( "keypress", { keyCode: $.ui.keyCode.LEFT } )
+ .simulate( "keyup", { keyCode: $.ui.keyCode.LEFT } );
+
+});
+test( "programmatic event triggers", function() {
+ expect(6);
+
+ // Test value method
+ var el = $( "<div></div>" )
+ .slider({
+ change: function(event, ui) {
+ ok( true, "change triggered by value method" );
+ }
+ })
+ .slider( "value", 0 );
+
+ QUnit.reset();
+ // Test values method
+ el = $( "<div></div>" )
+ .slider({
+ values: [ 10, 20 ],
+ change: function(event, ui) {
+ ok( true, "change triggered by values method" );
+ }
+ })
+ .slider( "values", [80, 90] );
+
+ QUnit.reset();
+ // Test value option
+ el = $( "<div></div>" )
+ .slider({
+ change: function(event, ui) {
+ ok( true, "change triggered by value option" );
+ }
+ })
+ .slider( "option", "value", 0 );
+
+ QUnit.reset();
+ // Test values option
+ el = $( "<div></div>" )
+ .slider({
+ values: [ 10, 20 ],
+ change: function(event, ui) {
+ ok( true, "change triggered by values option" );
+ }
+ })
+ .slider( "option", "values", [80, 90] );
+
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js
new file mode 100644
index 0000000..66624e8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js
@@ -0,0 +1,102 @@
+/*
+ * slider_methods.js
+ */
+(function($) {
+
+module("slider: methods");
+
+test("init", function() {
+ expect(5);
+
+ $("<div></div>").appendTo('body').slider().remove();
+ ok(true, '.slider() called on element');
+
+ $([]).slider().remove();
+ ok(true, '.slider() called on empty collection');
+
+ $('<div></div>').slider().remove();
+ ok(true, '.slider() called on disconnected DOMElement');
+
+ var el = $('<div></div>').slider();
+ var foo = el.slider("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').slider().slider("option", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on element');
+
+ $([]).slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on empty collection');
+
+ $('<div></div>').appendTo('body').remove().slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on disconnected DOMElement');
+
+ var expected = $('<div></div>').slider(),
+ actual = expected.slider('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ var expected = $('<div></div>').slider(),
+ actual = expected.slider('enable');
+ equals(actual, expected, 'enable is chainable');
+
+ var el = $('<div></div>').slider({ disabled: true });
+ ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class before enable method call');
+ ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call');
+ el.slider('enable');
+ ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class after enable method call');
+ ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class after enable method call');
+});
+
+test("disable", function() {
+ var expected = $('<div></div>').slider(),
+ actual = expected.slider('disable');
+ equals(actual, expected, 'disable is chainable');
+
+ var el = $('<div></div>').slider({ disabled: false });
+ ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class before disabled method call');
+ ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call');
+ el.slider('disable');
+ ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class after disable method call');
+ ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class after disable method call');
+});
+
+test("value", function() {
+ $([false, 'min', 'max']).each(function() {
+ var el = $('<div></div>').slider({
+ range: this,
+ value: 5
+ });
+ equals(el.slider('value'), 5, 'range: ' + this + ' slider method get');
+ equals(el.slider('value', 10), el, 'value method is chainable');
+ equals(el.slider('value'), 10, 'range: ' + this + ' slider method set');
+ el.remove();
+ });
+ var el = $('<div></div>').slider({
+ min: -1, value: 0, max: 1
+ });
+ // min with value option vs value method
+ el.slider('option', 'value', -2);
+ equals(el.slider('option', 'value'), -2, 'value option does not respect min');
+ equals(el.slider('value'), -1, 'value method get respects min');
+ equals(el.slider('value', -2), el, 'value method is chainable');
+ equals(el.slider('option', 'value'), -1, 'value method set respects min');
+ // max with value option vs value method
+ el.slider('option', 'value', 2);
+ equals(el.slider('option', 'value'), 2, 'value option does not respect max');
+ equals(el.slider('value'), 1, 'value method get respects max');
+ equals(el.slider('value', 2), el, 'value method is chainable');
+ equals(el.slider('option', 'value'), 1, 'value method set respects max');
+});
+
+//test("values", function() {
+// ok(false, "missing test - untested code is broken code.");
+//});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js
new file mode 100644
index 0000000..040589b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js
@@ -0,0 +1,146 @@
+/*
+ * slider_options.js
+ */
+(function($) {
+
+var el, options;
+
+function handle() {
+ return el.find(".ui-slider-handle");
+}
+
+module("slider: options");
+
+test("max", function() {
+ el = $('<div></div>');
+
+ options = {
+ max: 37,
+ min: 6,
+ orientation: 'horizontal',
+ step: 1,
+ value: 50
+ };
+
+ el.slider(options);
+ ok(el.slider("option", "value") == options.value, "value option is not contained by max");
+ ok(el.slider("value") == options.max, "value method is contained by max");
+ el.slider('destroy');
+
+});
+
+test("min", function() {
+ el = $('<div></div>');
+
+ options = {
+ max: 37,
+ min: 6,
+ orientation: 'vertical',
+ step: 1,
+ value: 2
+ };
+
+ el.slider(options);
+ ok(el.slider("option", "value") == options.value, "value option is not contained by min");
+ ok(el.slider("value") == options.min, "value method is contained by min");
+ el.slider('destroy');
+
+});
+
+test("orientation", function() {
+ el = $('<div></div>');
+
+ options = {
+ max: 2,
+ min: -2,
+ orientation: 'vertical',
+ value: 1
+ };
+
+ var percentVal = (options.value - options.min) / (options.max - options.min) * 100;
+
+ el.slider(options).slider("option", "orientation", "horizontal");
+ ok(el.is('.ui-slider-horizontal'), "horizontal slider has class .ui-slider-horizontal");
+ ok(!el.is('.ui-slider-vertical'), "horizontal slider does not have class .ui-slider-vertical");
+ equals(handle().css('left'), percentVal + '%', "horizontal slider handle is positioned with left: %");
+
+ el.slider('destroy');
+
+ options = {
+ max: 2,
+ min: -2,
+ orientation: 'horizontal',
+ value: -1
+ };
+
+ var percentVal = (options.value - options.min) / (options.max - options.min) * 100;
+
+ el.slider(options).slider("option", "orientation", "vertical");
+ ok(el.is('.ui-slider-vertical'), "vertical slider has class .ui-slider-vertical");
+ ok(!el.is('.ui-slider-horizontal'), "vertical slider does not have class .ui-slider-horizontal");
+ equals(handle().css('bottom'), percentVal + '%', "vertical slider handle is positioned with bottom: %");
+
+ el.slider('destroy');
+
+});
+
+//test("range", function() {
+// ok(false, "missing test - untested code is broken code.");
+//});
+
+//spec: http://wiki.jqueryui.com/Slider#specs
+// value option/method: the value option is not restricted by min/max/step.
+// What is returned by the value method is restricted by min (>=), max (<=), and step (even multiple)
+test("step", function() {
+ var el = $('<div></div>').slider({
+ min: 0,
+ value: 0,
+ step: 10,
+ max: 100
+ });
+ equals( el.slider("value"), 0 );
+
+ el.slider("value", 1);
+ equals( el.slider("value"), 0 );
+
+ el.slider("value", 9);
+ equals( el.slider("value"), 10 );
+
+ el.slider("value", 11);
+ equals( el.slider("value"), 10 );
+
+ el.slider("value", 19);
+ equals( el.slider("value"), 20 );
+
+el = $('<div></div>').slider({
+ min: 0,
+ value: 0,
+ step: 20,
+ max: 100
+ });
+ el.slider("value", 0);
+
+ el.slider("option", "value", 1);
+ equals( el.slider("value"), 0 );
+
+ el.slider("option", "value", 9);
+ equals( el.slider("value"), 0 );
+
+ el.slider("option", "value", 11);
+ equals( el.slider("value"), 20 );
+
+ el.slider("option", "value", 19);
+ equals( el.slider("value"), 20 );
+
+ el.slider('destroy');
+});
+
+//test("value", function() {
+// ok(false, "missing test - untested code is broken code.");
+//});
+
+//test("values", function() {
+// ok(false, "missing test - untested code is broken code.");
+//});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html
new file mode 100644
index 0000000..0ee6b56
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Sortable Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "sortable" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Sortable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html
new file mode 100644
index 0000000..a20eb71
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Sortable Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.sortable" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.mouse.js",
+ "ui/jquery.ui.sortable.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="sortable_core.js"></script>
+ <script src="sortable_defaults.js"></script>
+ <script src="sortable_events.js"></script>
+ <script src="sortable_methods.js"></script>
+ <script src="sortable_options.js"></script>
+ <script src="sortable_tickets.js"></script>
+
+ <script>
+ // disable this stale testsuite for testswarm only
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( url && url.indexOf("http") == 0 ) {
+ // reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
+ QUnit.init();
+ test("sortable", function() { ok(true, "disabled sortable testsuite"); });
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Sortable Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<ul id="sortable">
+ <li>Item 1</li>
+ <li>Item 2</li>
+ <li>Item 3</li>
+ <li>Item 4</li>
+ <li>Item 5</li>
+</ul>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js
new file mode 100644
index 0000000..ff18598
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js
@@ -0,0 +1,9 @@
+/*
+ * sortable_core.js
+ */
+
+(function($) {
+
+module("sortable: core");
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js
new file mode 100644
index 0000000..7681add
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js
@@ -0,0 +1,34 @@
+/*
+ * sortable_defaults.js
+ */
+
+var sortable_defaults = {
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectWith: false,
+ containment: false,
+ cursor: 'auto',
+ cursorAt: false,
+ delay: 0,
+ disabled: false,
+ distance: 1,
+ 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
+};
+
+commonWidgetTests('sortable', { defaults: sortable_defaults });
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js
new file mode 100644
index 0000000..cb4ff4f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js
@@ -0,0 +1,147 @@
+/*
+ * sortable_events.js
+ */
+(function($) {
+
+module("sortable: events");
+
+test("start", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ start: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 });
+
+ ok(hash, 'start event triggered');
+ ok(hash.helper, 'UI hash includes: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+
+});
+
+test("sort", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ sort: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 });
+
+ ok(hash, 'sort event triggered');
+ ok(hash.helper, 'UI hash includes: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+});
+
+test("change", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ change: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 });
+
+ ok(!hash, '1px drag, change event should not be triggered');
+
+ $("#sortable")
+ .sortable({ change: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
+
+ ok(hash, 'change event triggered');
+ ok(hash.helper, 'UI hash includes: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+});
+
+test("beforeStop", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ beforeStop: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
+
+ ok(hash, 'beforeStop event triggered');
+ ok(hash.helper, 'UI hash includes: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+});
+
+test("stop", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ stop: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
+
+ ok(hash, 'stop event triggered');
+ ok(!hash.helper, 'UI should not include: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+});
+
+test("update", function() {
+
+ var hash;
+ $("#sortable")
+ .sortable({ update: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 });
+
+ ok(!hash, '1px drag, update event should not be triggered');
+
+ $("#sortable")
+ .sortable({ update: function(e, ui) { hash = ui; } })
+ .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
+
+ ok(hash, 'update event triggered');
+ ok(!hash.helper, 'UI hash should not include: helper');
+ ok(hash.placeholder, 'UI hash includes: placeholder');
+ ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
+ ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
+ ok(hash.item, 'UI hash includes: item');
+ ok(!hash.sender, 'UI hash does not include: sender');
+
+});
+
+test("receive", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("remove", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("over", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("out", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("activate", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("deactivate", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js
new file mode 100644
index 0000000..c4b5cdc
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js
@@ -0,0 +1,108 @@
+/*
+ * sortable_methods.js
+ */
+(function($) {
+
+var el, offsetBefore, offsetAfter, dragged;
+
+var drag = function(handle, dx, dy) {
+ offsetBefore = $(handle).offset();
+ $(handle).simulate("drag", {
+ dx: dx || 0,
+ dy: dy || 0
+ });
+ dragged = { dx: dx, dy: dy };
+ offsetAfter = $(handle).offset();
+}
+
+var sort = function(handle, dx, dy, index, msg) {
+ drag(handle, dx, dy);
+ equals($(handle).parent().children().index(handle), index, msg);
+}
+
+module("sortable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').sortable().remove();
+ ok(true, '.sortable() called on element');
+
+ $([]).sortable();
+ ok(true, '.sortable() called on empty collection');
+
+ $("<div></div>").sortable();
+ ok(true, '.sortable() called on disconnected DOMElement');
+
+ $("<div></div>").sortable().sortable("foo");
+ ok(true, 'arbitrary method called after init');
+
+ $("<div></div>").sortable().sortable("option", "foo");
+ ok(true, 'arbitrary option getter after init');
+
+ $("<div></div>").sortable().sortable("option", "foo", "bar");
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').sortable().sortable("destroy").remove();
+ ok(true, '.sortable("destroy") called on element');
+
+ $([]).sortable().sortable("destroy");
+ ok(true, '.sortable("destroy") called on empty collection');
+
+ $("<div></div>").sortable().sortable("destroy");
+ ok(true, '.sortable("destroy") called on disconnected DOMElement');
+
+ $("<div></div>").sortable().sortable("destroy").sortable("foo");
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').sortable(),
+ actual = expected.sortable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ expect(5);
+ el = $("#sortable").sortable({ disabled: true });
+
+ sort($("li", el)[0], 0, 40, 0, '.sortable({ disabled: true })');
+
+ el.sortable("enable");
+ equals(el.sortable("option", "disabled"), false, "disabled option getter");
+
+ el.sortable("destroy");
+ el.sortable({ disabled: true });
+ el.sortable("option", "disabled", false);
+ equals(el.sortable("option", "disabled"), false, "disabled option setter");
+
+ sort($("li", el)[0], 0, 40, 2, '.sortable("option", "disabled", false)');
+
+ var expected = $('<div></div>').sortable(),
+ actual = expected.sortable('enable');
+ equals(actual, expected, 'enable is chainable');
+});
+
+test("disable", function() {
+ expect(7);
+ el = $("#sortable").sortable({ disabled: false });
+ sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
+
+ el.sortable("disable");
+ sort($("li", el)[0], 0, 40, 0, 'disabled.sortable getter');
+
+ el.sortable("destroy");
+
+ el.sortable({ disabled: false });
+ sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
+ el.sortable("option", "disabled", true);
+ equals(el.sortable("option", "disabled"), true, "disabled option setter");
+ ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction");
+ sort($("li", el)[0], 0, 40, 0, '.sortable("option", "disabled", true)');
+
+ var expected = $('<div></div>').sortable(),
+ actual = expected.sortable('disable');
+ equals(actual, expected, 'disable is chainable');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js
new file mode 100644
index 0000000..507d5dc
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js
@@ -0,0 +1,256 @@
+/*
+ * sortable_options.js
+ */
+(function($) {
+
+module("sortable: options");
+
+test("{ appendTo: 'parent' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ appendTo: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ axis: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ axis: 'x' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ axis: 'y' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ axis: ? }, unexpected", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cancel: ':input,button' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cancel: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ connectWith: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ connectWith: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: Element }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: 'document' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: 'parent' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: 'window' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ containment: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cursor: 'auto' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cursor: 'move' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cursorAt: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ cursorAt: true }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ delay: 0 }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ delay: 100 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ distance: 1 }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ distance: 10 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ dropOnEmpty: true }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ dropOnEmpty: false }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ forcePlaceholderSize: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ forcePlaceholderSize: true }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ forceHelperSize: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ forceHelperSize: true }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ grid: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ grid: [17, 3] }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ grid: [3, 7] }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ handle: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ handle: Element }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ handle: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ helper: 'original' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ helper: Function }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ items: '> *' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ items: Selector }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ opacity: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ opacity: .37 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ opacity: 1 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ placeholder: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ placeholder: String }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ revert: false }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ revert: true }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scroll: true }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scroll: false }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSensitivity: 20 }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSensitivity: 2 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSensitivity: 200 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSpeed: 20 }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSpeed: 2 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scrollSpeed: 200 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scope: 'default' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ scope: ??? }, unexpected", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ tolerance: 'intersect' }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ tolerance: 'pointer' }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ zIndex: 1000 }, default", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ zIndex: 1 }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("{ zIndex: false }", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js
new file mode 100644
index 0000000..3edc8c0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js
@@ -0,0 +1,83 @@
+/*
+ * sortable_tickets.js
+ */
+(function($) {
+
+var el, offsetBefore, offsetAfter, dragged;
+
+var drag = function(handle, dx, dy) {
+ offsetBefore = $(handle).offset();
+ $(handle).simulate("drag", {
+ dx: dx || 0,
+ dy: dy || 0
+ });
+ dragged = { dx: dx, dy: dy };
+ offsetAfter = $(handle).offset();
+}
+
+var sort = function(handle, dx, dy, index, msg) {
+ drag(handle, dx, dy);
+ equals($(handle).parent().children().index(handle), index, msg);
+}
+
+module("sortable: tickets");
+
+test("#3019: Stop fires too early", function() {
+
+ var helper = null;
+ el = $("#sortable").sortable({
+ stop: function(event, ui) {
+ helper = ui.helper;
+ }
+ });
+
+ sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable');
+ equals(helper, null, "helper should be false");
+
+});
+
+test('#4752: link event firing on sortable with connect list', function () {
+ var fired = {},
+ hasFired = function (type) { return (type in fired) && (true === fired[type]); };
+
+ $('#sortable').clone().attr('id', 'sortable2').insertAfter('#sortable');
+
+ $('#main ul').sortable({
+ connectWith: '#main ul',
+ change: function (e, ui) {
+ fired.change = true;
+ },
+ receive: function (e, ui) {
+ fired.receive = true;
+ },
+ remove: function (e, ui) {
+ fired.remove = true;
+ }
+ });
+
+ $('#main ul li').live('click.ui-sortable-test', function () {
+ fired.click = true;
+ });
+
+ $('#sortable li:eq(0)').simulate('click');
+ ok(!hasFired('change'), 'Click only, change event should not have fired');
+ ok(hasFired('click'), 'Click event should have fired');
+
+ // Drag an item within the first list
+ fired = {};
+ $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 40 });
+ ok(hasFired('change'), '40px drag, change event should have fired');
+ ok(!hasFired('receive'), 'Receive event should not have fired');
+ ok(!hasFired('remove'), 'Remove event should not have fired');
+ ok(!hasFired('click'), 'Click event should not have fired');
+
+ // Drag an item from the first list to the second, connected list
+ fired = {};
+ $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 150 });
+ ok(hasFired('change'), '150px drag, change event should have fired');
+ ok(hasFired('receive'), 'Receive event should have fired');
+ ok(hasFired('remove'), 'Remove event should have fired');
+ ok(!hasFired('click'), 'Click event should not have fired');
+});
+
+})(jQuery);
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html
new file mode 100644
index 0000000..1075362
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Spinner Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "spinner" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Spinner Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html
new file mode 100644
index 0000000..0c01a5f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Spinner Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../../external/globalize.js"></script>
+ <script src="../../../external/globalize.culture.ja-JP.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.button", "ui.spinner" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.button.js",
+ "ui/jquery.ui.spinner.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="spinner_test_helpers.js"></script>
+ <script src="spinner_core.js"></script>
+ <script src="spinner_defaults.js"></script>
+ <script src="spinner_events.js"></script>
+ <script src="spinner_methods.js"></script>
+ <script src="spinner_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Spinner Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<input id="spin" class="foo">
+<input id="spin2" value="2">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js
new file mode 100644
index 0000000..e12d1af
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js
@@ -0,0 +1,206 @@
+(function( $ ) {
+
+module( "spinner: core" );
+
+test( "keydown UP on input, increases value not greater than max", function() {
+ expect( 5 );
+ var element = $( "#spin" ).val( 70 ).spinner({
+ max: 100,
+ step: 10
+ });
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equal( element.val(), 80 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equal( element.val(), 90 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equal( element.val(), 100 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equal( element.val(), 100 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equal( element.val(), 100 );
+});
+
+test( "keydown DOWN on input, decreases value not less than min", function() {
+ expect( 5 );
+ var element = $( "#spin" ).val( 50 ).spinner({
+ min: 20,
+ step: 10
+ });
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equal( element.val(), 40 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equal( element.val(), 30 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equal( element.val(), 20 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equal( element.val(), 20 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equal( element.val(), 20 );
+});
+
+test( "keydown PAGE_UP on input, increases value not greater than max", function() {
+ expect( 5 );
+ var element = $( "#spin" ).val( 70 ).spinner({
+ max: 100,
+ page: 10
+ });
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equal( element.val(), 80 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equal( element.val(), 90 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equal( element.val(), 100 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equal( element.val(), 100 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equal( element.val(), 100 );
+});
+
+test( "keydown PAGE_DOWN on input, decreases value not less than min", function() {
+ expect( 5 );
+ var element = $( "#spin" ).val( 50 ).spinner({
+ min: 20,
+ page: 10
+ });
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equal( element.val(), 40 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equal( element.val(), 30 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equal( element.val(), 20 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equal( element.val(), 20 );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equal( element.val(), 20 );
+});
+
+test( "mouse click on up button, increases value not greater than max", function() {
+ expect( 3 );
+ var element = $( "#spin" ).val( 18 ).spinner({
+ max: 20
+ }),
+ button = element.spinner( "widget" ).find( ".ui-spinner-up" );
+
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 19 );
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 20 );
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 20 );
+});
+
+test( "mouse click on up button, increases value not greater than max", function() {
+ expect( 3 );
+ var element = $( "#spin" ).val( 2 ).spinner({
+ min: 0
+ }),
+ button = element.spinner( "widget" ).find( ".ui-spinner-down" );
+
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 1 );
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 0 );
+ button.trigger( "mousedown" ).trigger( "mouseup" );
+ equal( element.val(), 0 );
+});
+
+test( "mousewheel on input", function() {
+ expect( 4 );
+
+ var element = $( "#spin" ).val( 0 ).spinner({
+ step: 2
+ });
+
+ element.trigger( "mousewheel" );
+ equal( element.val(), 0, "mousewheel event without delta does not change value" );
+
+ element.trigger( "mousewheel", 1 );
+ equal( element.val(), 2 );
+
+ element.trigger( "mousewheel", -0.2 );
+ equal( element.val(), 0 );
+
+ element.trigger( "mousewheel", -15 );
+ equal(element.val(), -2 );
+});
+
+test( "reading HTML5 attributes", function() {
+ expect( 6 );
+ var markup = "<input type='number' min='-100' max='100' value='5' step='2'>",
+ element = $( markup ).spinner();
+ equal( element.spinner( "option", "min" ), -100, "min from markup" );
+ equal( element.spinner( "option", "max" ), 100, "max from markup" );
+ equal( element.spinner( "option", "step" ), 2, "step from markup" );
+
+ element = $( markup ).spinner({
+ min: -200,
+ max: 200,
+ step: 5
+ });
+ equal( element.spinner( "option", "min" ), -200, "min from options" );
+ equal( element.spinner( "option", "max" ), 200, "max from options" );
+ equal( element.spinner( "option", "step" ), 5, "stop from options" );
+});
+
+test( "ARIA attributes", function() {
+ expect( 9 );
+ var element = $( "#spin" ).val( 2 ).spinner({ min: -5, max: 5 });
+
+ equal( element.attr( "role" ), "spinbutton", "role" );
+ equal( element.attr( "aria-valuemin" ), "-5", "aria-valuemin" );
+ equal( element.attr( "aria-valuemax" ), "5", "aria-valuemax" );
+ equal( element.attr( "aria-valuenow" ), "2", "aria-valuenow" );
+
+ element.spinner( "stepUp" );
+
+ equal( element.attr( "aria-valuenow" ), "3", "stepUp 1 step changes aria-valuenow" );
+
+ element.spinner( "option", { min: -10, max: 10 } );
+
+ equal( element.attr( "aria-valuemin" ), "-10", "min option changed aria-valuemin changes" );
+ equal( element.attr( "aria-valuemax" ), "10", "max option changed aria-valuemax changes" );
+
+ element.spinner( "option", "min", null );
+ equal( element.attr( "aria-valuemin" ), undefined, "aria-valuemin not set when no min" );
+
+ element.spinner( "option", "max", null );
+ equal( element.attr( "aria-valuemax" ), undefined, "aria-valuemax not set when no max" );
+});
+
+test( "focus text field when pressing button", function() {
+ expect( 2 );
+ var element = $( "#spin" ).spinner();
+ $( "body" ).focus();
+ ok( element[ 0 ] !== document.activeElement, "not focused before" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown();
+ ok( element[ 0 ] === document.activeElement, "focused after" );
+});
+
+test( "don't clear invalid value on blur", function() {
+ expect( 1 );
+ var element = $( "#spin" ).spinner();
+ element.focus().val( "a" ).blur();
+ equal( element.val(), "a" );
+});
+
+test( "precision", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( .05 ).spinner({
+ step: .0001
+ });
+ element.spinner( "stepUp" );
+ equal( element.val(), "0.0501", "precision from step" );
+
+ element.val( 1.05 ).spinner( "option", {
+ step: 1,
+ min: -9.95
+ });
+ element.spinner( "stepDown" );
+ equal( element.val(), "0.05", "precision from min" );
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js
new file mode 100644
index 0000000..0a4e7c2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js
@@ -0,0 +1,19 @@
+commonWidgetTests( "spinner", {
+ defaults: {
+ culture: null,
+ disabled: false,
+ incremental: true,
+ max: null,
+ min: null,
+ numberFormat: null,
+ page: 10,
+ step: 1,
+
+ // callbacks
+ change: null,
+ create: null,
+ spin: null,
+ start: null,
+ stop: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js
new file mode 100644
index 0000000..e43ba33
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js
@@ -0,0 +1,221 @@
+(function( $ ) {
+
+module( "spinner: events" );
+
+test( "start", function() {
+ expect( 6 );
+ var element = $( "#spin" ).spinner();
+
+ function shouldStart( expectation, msg ) {
+ element.spinner( "option", "start", function() {
+ ok( expectation, msg );
+ });
+ }
+
+ shouldStart( true, "key UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ shouldStart( true, "key DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+
+ shouldStart( true, "key PAGE_UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ shouldStart( true, "key PAGE_DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+
+ shouldStart( true, "button up" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ shouldStart( true, "button down" );
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+
+ shouldStart( false, "stepUp" );
+ element.spinner( "stepUp" );
+ shouldStart( false, "stepDown" );
+ element.spinner( "stepDown" );
+
+ shouldStart( false, "pageUp" );
+ element.spinner( "pageUp" );
+ shouldStart( false, "pageDown" );
+ element.spinner( "pageDown" );
+
+ shouldStart( false, "value" );
+ element.spinner( "value", 999 );
+});
+
+test( "spin", function() {
+ expect( 6 );
+ var element = $( "#spin" ).spinner();
+
+ function shouldSpin( expectation, msg ) {
+ element.spinner( "option", "spin", function() {
+ ok( expectation, msg );
+ });
+ }
+
+ shouldSpin( true, "key UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ shouldSpin( true, "key DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+
+ shouldSpin( true, "key PAGE_UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ shouldSpin( true, "key PAGE_DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+
+ shouldSpin( true, "button up" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ shouldSpin( true, "button down" );
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+
+ shouldSpin( false, "stepUp" );
+ element.spinner( "stepUp" );
+ shouldSpin( false, "stepDown" );
+ element.spinner( "stepDown" );
+
+ shouldSpin( false, "pageUp" );
+ element.spinner( "pageUp" );
+ shouldSpin( false, "pageDown" );
+ element.spinner( "pageDown" );
+
+ shouldSpin( false, "value" );
+ element.spinner( "value", 999 );
+});
+
+test( "stop", function() {
+ expect( 6 );
+ var element = $( "#spin" ).spinner();
+
+ function shouldStop( expectation, msg ) {
+ element.spinner( "option", "stop", function() {
+ ok( expectation, msg );
+ });
+ }
+
+ shouldStop( true, "key UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ shouldStop( true, "key DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+
+ shouldStop( true, "key PAGE_UP" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ shouldStop( true, "key PAGE_DOWN" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+
+ shouldStop( true, "button up" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ shouldStop( true, "button down" );
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+
+ shouldStop( false, "stepUp" );
+ element.spinner( "stepUp" );
+ shouldStop( false, "stepDown" );
+ element.spinner( "stepDown" );
+
+ shouldStop( false, "pageUp" );
+ element.spinner( "pageUp" );
+ shouldStop( false, "pageDown" );
+ element.spinner( "pageDown" );
+
+ shouldStop( false, "value" );
+ element.spinner( "value", 999 );
+});
+
+test( "change", function() {
+ expect( 14 );
+ var element = $( "#spin" ).spinner();
+
+ function shouldChange( expectation, msg ) {
+ element.spinner( "option", "change", function() {
+ ok( expectation, msg );
+ });
+ }
+
+ element.focus();
+ shouldChange( false, "key UP, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ shouldChange( true, "blur after key UP" );
+ element.blur();
+
+ element.focus();
+ shouldChange( false, "key DOWN, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ shouldChange( true, "blur after key DOWN" );
+ element.blur();
+
+ element.focus();
+ shouldChange( false, "key PAGE_UP, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ shouldChange( true, "blur after key PAGE_UP" );
+ element.blur();
+
+ element.focus();
+ shouldChange( false, "key PAGE_DOWN, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ shouldChange( true, "blur after key PAGE_DOWN" );
+ element.blur();
+
+ shouldChange( false, "many keys, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ shouldChange( true, "blur after many keys" );
+ element.blur();
+
+ shouldChange( false, "many keys, same final value, before blur" );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ shouldChange( false, "blur after many keys, same final value" );
+
+ shouldChange( false, "button up, before blur" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ shouldChange( true, "blur after button up" );
+ element.blur();
+
+ shouldChange( false, "button down, before blur" );
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+ shouldChange( true, "blur after button down" );
+ element.blur();
+
+ shouldChange( false, "many buttons, same final value, before blur" );
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup();
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+ element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup();
+ shouldChange( false, "blur after many buttons, same final value" );
+ element.blur();
+
+ shouldChange( true, "stepUp" );
+ element.spinner( "stepUp" );
+
+ shouldChange( true, "stepDown" );
+ element.spinner( "stepDown" );
+
+ shouldChange( true, "pageUp" );
+ element.spinner( "pageUp" );
+
+ shouldChange( true, "pageDown" );
+ element.spinner( "pageDown" );
+
+ shouldChange( true, "value" );
+ element.spinner( "value", 999 );
+
+ shouldChange( false, "value, same value" );
+ element.spinner( "value", 999 );
+
+ shouldChange( true, "max, value changed" );
+ element.spinner( "option", "max", 900 );
+
+ shouldChange( false, "max, value not changed" );
+ element.spinner( "option", "max", 1000 );
+
+ shouldChange( true, "min, value changed" );
+ element.spinner( "option", "min", 950 );
+
+ shouldChange( false, "min, value not changed" );
+ element.spinner( "option", "min", 200 );
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js
new file mode 100644
index 0000000..a9fd6c8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js
@@ -0,0 +1,164 @@
+(function( $ ) {
+
+module( "spinner: methods" );
+
+test( "destroy", function() {
+ expect( 1 );
+ domEqual( "#spin", function() {
+ $( "#spin" ).spinner().spinner( "destroy" );
+ });
+});
+
+test( "disable", function() {
+ expect( 14 );
+ var element = $( "#spin" ).val( 2 ).spinner(),
+ wrapper = $( "#spin" ).spinner( "widget" );
+
+ ok( !wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper does not have ui-spinner-disabled class" );
+ ok( !element.is( ":disabled" ), "before: input does not have disabled attribute" );
+
+ element.spinner( "disable" );
+ ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" );
+ ok( element.is( ":disabled"), "after: input has disabled attribute" );
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equals( 2, element.val(), "keyboard - value does not change on key UP" );
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN );
+ equals( 2, element.val(), "keyboard - value does not change on key DOWN" );
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP );
+ equals( 2, element.val(), "keyboard - value does not change on key PGUP" );
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN );
+ equals( 2, element.val(), "keyboard - value does not change on key PGDN" );
+
+ wrapper.find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" );
+ equals( 2, element.val(), "mouse - value does not change on clicking up button" );
+
+ wrapper.find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" );
+ equals( 2, element.val(), "mouse - value does not change on clicking down button" );
+
+ element.spinner( "stepUp", 6 );
+ equals( 8, element.val(), "script - stepUp 6 steps changes value");
+
+ element.spinner( "stepDown" );
+ equals( 7, element.val(), "script - stepDown 1 step changes value" );
+
+ element.spinner( "pageUp" );
+ equals( 17, element.val(), "script - pageUp 1 page changes value" );
+
+ element.spinner( "pageDown" );
+ equals( 7, element.val(), "script - pageDown 1 page changes value" );
+});
+
+test( "enable", function() {
+ expect( 5 );
+ var element = $( "#spin" ).val( 1 ).spinner({ disabled: true })
+ wrapper = element.spinner( "widget" );
+
+ ok( wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper has ui-spinner-disabled class" );
+ ok( element.is( ":disabled" ), "before: input has disabled attribute" );
+
+ element.spinner( "enable" );
+
+ ok( !wrapper.hasClass( ".ui-spinner-disabled" ), "after: wrapper does not have ui-spinner-disabled class" );
+ ok( !element.is( ":disabled" ), "after: input does not have disabled attribute" );
+
+ spinner_simulateKeyDownUp( element, $.ui.keyCode.UP );
+ equals( 2, element.val(), "keyboard - value changes on key UP" );
+});
+
+test( "pageDown", function() {
+ expect( 4 );
+ var element = $( "#spin" ).val( -12 ).spinner({
+ page: 20,
+ min: -100
+ });
+
+ element.spinner( "pageDown" );
+ equals( element.val(), -32, "pageDown 1 page" );
+
+ element.spinner( "pageDown", 3 );
+ equals( element.val(), -92, "pageDown 3 pages" );
+
+ element.spinner( "pageDown" );
+ equals( element.val(), -100, "value close to min and pageDown 1 page" );
+
+ element.spinner( "pageDown", 10 );
+ equals( element.val(), -100, "value at min and pageDown 10 pages" );
+});
+
+test( "pageUp", function() {
+ expect( 4 );
+ var element = $( "#spin" ).val( 12 ).spinner({
+ page: 20,
+ max: 100
+ });
+
+ element.spinner( "pageUp" );
+ equals( element.val(), 32, "pageUp 1 page" );
+
+ element.spinner( "pageUp", 3 );
+ equals( element.val(), 92, "pageUp 3 pages" );
+
+ element.spinner( "pageUp" );
+ equals( element.val(), 100, "value close to max and pageUp 1 page" );
+
+ element.spinner( "pageUp", 10 );
+ equals( element.val(), 100, "value at max and pageUp 10 pages" );
+});
+
+test( "stepDown", function() {
+ expect( 4 );
+ var element = $( "#spin" ).val( 0 ).spinner({
+ step: 2,
+ min: -15
+ });
+
+ element.spinner( "stepDown" );
+ equals( element.val(), "-1", "stepDown 1 step" );
+
+ element.spinner( "stepDown", 5 );
+ equals( element.val(), "-11", "stepDown 5 steps" );
+
+ element.spinner( "stepDown", 4 );
+ equals( element.val(), "-15", "close to min and stepDown 4 steps" );
+
+ element.spinner( "stepDown" );
+ equals( element.val(), "-15", "at min and stepDown 1 step" );
+});
+
+test( "stepUp", function() {
+ expect( 4 );
+ var element = $( "#spin" ).val( 0 ).spinner({
+ step: 2,
+ max: 16
+ });
+
+ element.spinner( "stepUp" );
+ equals( element.val(), 2, "stepUp 1 step" );
+
+ element.spinner( "stepUp", 5 );
+ equals( element.val(), 12, "stepUp 5 steps" );
+
+ element.spinner( "stepUp", 4 );
+ equals( element.val(), 16, "close to min and stepUp 4 steps" );
+
+ element.spinner( "stepUp" );
+ equals( element.val(), 16, "at max and stepUp 1 step" );
+});
+
+test( "value", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({
+ step: 3
+ });
+
+ element.spinner( "value", 10 );
+ equals( element.val(), 9, "change value via value method" );
+
+ equals( element.spinner( "value" ), 9, "get value via value method" );
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js
new file mode 100644
index 0000000..81f434f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js
@@ -0,0 +1,190 @@
+(function( $ ) {
+
+module( "spinner: options" );
+
+// culture is tested after numberFormat, since it depends on numberFormat
+
+test( "incremental, false", function() {
+ expect( 100 );
+
+ var i, diff,
+ prev = 0,
+ element = $( "#spin" ).val( prev ).spinner({
+ incremental: false,
+ spin: function( event, ui ) {
+ equal( ui.value - prev, 1 );
+ prev = ui.value;
+ }
+ });
+
+ for ( i = 0; i < 100; i++ ) {
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ }
+ element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } );
+});
+
+test( "incremental, true", function() {
+ expect( 100 );
+
+ function fill( num, val ) {
+ return $.map( new Array( num ), function() {
+ return val;
+ });
+ }
+
+ var i, diff,
+ prev = 0,
+ expected = [].concat( fill( 18, 1 ), fill( 37, 2 ), fill( 14, 3 ),
+ fill( 9, 4 ), fill( 6, 5 ), fill( 5, 6 ), fill ( 5, 7 ),
+ fill( 4, 8 ), fill( 2, 9 ) ),
+ element = $( "#spin" ).val( prev ).spinner({
+ incremental: true,
+ spin: function( event, ui ) {
+ equal( ui.value - prev, expected[ i ] );
+ prev = ui.value;
+ }
+ });
+
+ for ( i = 0; i < 100; i++ ) {
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ }
+ element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } );
+});
+
+test( "incremental, function", function() {
+ expect( 100 );
+
+ var i,
+ prev = 0,
+ element = $( "#spin" ).val( prev ).spinner({
+ incremental: function( i ) {
+ return i;
+ },
+ spin: function( event, ui ) {
+ equal( ui.value - prev, i + 1 );
+ prev = ui.value;
+ }
+ });
+
+ for ( i = 0; i < 100; i++ ) {
+ element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
+ }
+ element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } );
+});
+
+test( "numberFormat, number", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "n" });
+ equal( element.val(), "0.00", "formatted on init" );
+ element.spinner( "stepUp" );
+ equal( element.val(), "1.00", "formatted after step" );
+});
+
+test( "numberFormat, number, simple", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "n0" });
+ equal( element.val(), "0", "formatted on init" );
+ element.spinner( "stepUp" );
+ equal( element.val(), "1", "formatted after step" );
+});
+
+test( "numberFormat, currency", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "C" });
+ equal( element.val(), "$0.00", "formatted on init" );
+ element.spinner( "stepUp" );
+ equal( element.val(), "$1.00", "formatted after step" );
+});
+
+test( "numberFormat, change", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 5 ).spinner({ numberFormat: "n1" });
+ equal( element.val(), "5.0", "formatted on init" );
+ element.spinner( "option", "numberFormat", "c" );
+ equal( element.val(), "$5.00", "formatted after change" );
+});
+
+test( "culture, null", function() {
+ expect( 2 );
+ Globalize.culture( "ja-JP" );
+ var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "C" });
+ equal( element.val(), "¥0", "formatted on init" );
+ element.spinner( "stepUp" );
+ equal( element.val(), "¥1", "formatted after step" );
+
+ // reset culture
+ Globalize.culture( "default" );
+});
+
+test( "currency, ja-JP", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({
+ numberFormat: "C",
+ culture: "ja-JP"
+ });
+ equal( element.val(), "¥0", "formatted on init" );
+ element.spinner( "stepUp" );
+ equal( element.val(), "¥1", "formatted after step" );
+});
+
+test( "currency, change", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 5 ).spinner({
+ numberFormat: "C",
+ culture: "ja-JP"
+ });
+ equal( element.val(), "¥5", "formatted on init" );
+ element.spinner( "option", "culture", "en" );
+ equal( element.val(), "$5.00", "formatted after change" );
+});
+
+test( "max", function() {
+ expect( 3 );
+ var element = $( "#spin" ).val( 1000 ).spinner({ max: 100 });
+ equals( element.val(), 1000, "value not constrained on init" );
+
+ element.spinner( "value", 1000 );
+ equals( element.val(), 100, "max constrained if value method is greater" );
+
+ element.val( 1000 ).blur();
+ equals( element.val(), 1000, "max not constrained if manual entry" );
+});
+
+test( "min", function() {
+ expect( 3 );
+ var element = $( "#spin" ).val( -1000 ).spinner({ min: -100 });
+ equals( element.val(), -1000, "value not constrained on init" );
+
+ element.spinner( "value", -1000 );
+ equals( element.val(), -100, "min constrained if value method is greater" );
+
+ element.val( -1000 ).blur();
+ equals( element.val(), -1000, "min not constrained if manual entry" );
+});
+
+test( "step, 2", function() {
+ expect( 3 );
+ var element = $( "#spin" ).val( 0 ).spinner({ step: 2 });
+
+ element.spinner( "stepUp" );
+ equals( element.val(), "2", "stepUp" );
+
+ element.spinner( "value", "10.5" );
+ equals( element.val(), "10", "value reset to 10" );
+
+ element.val( "4.5" );
+ element.spinner( "stepUp" );
+ equals( element.val(), "6", "stepUp" );
+});
+
+test( "step, 0.7", function() {
+ expect( 1 );
+ var element = $("#spin").val( 0 ).spinner({
+ step: 0.7
+ });
+
+ element.spinner( "stepUp" );
+ equals( element.val(), "0.7", "stepUp" );
+});
+
+})( jQuery );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js
new file mode 100644
index 0000000..af555db
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js
@@ -0,0 +1,5 @@
+var spinner_simulateKeyDownUp = function( element, keyCode, shift ) {
+ element
+ .simulate( "keydown", { keyCode: keyCode, shiftKey: shift || false } )
+ .simulate( "keyup", { keyCode: keyCode, shiftKey: shift || false } );
+};
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js
new file mode 100644
index 0000000..e584d28
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js
@@ -0,0 +1,21 @@
+(function() {
+
+var versions = [ "1.6", "1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.7", "1.7.1", "git" ];
+
+var additionalTests = {
+ accordion: [ "accordion_deprecated.html" ],
+ position: [ "position_deprecated.html" ],
+ tabs: [ "tabs_deprecated.html" ]
+};
+
+window.testAllVersions = function( widget ) {
+ QUnit.testSuites( $.map(
+ [ widget + ".html" ].concat( additionalTests[ widget ] || [] ),
+ function( test ) {
+ return $.map( versions, function( version ) {
+ return test + "?jquery=" + version;
+ });
+ }));
+};
+
+}());
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css
new file mode 100644
index 0000000..bca30a7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css
@@ -0,0 +1,8 @@
+iframe.qunit-subsuite {
+ margin: 0;
+ padding: 0;
+ border-width: 1px 0 0;
+ height: 600px;
+ width: 100%;
+ background: #fff;
+} \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js
new file mode 100644
index 0000000..ddfccc7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js
@@ -0,0 +1,82 @@
+(function( QUnit ) {
+
+var subsuiteFrame;
+
+QUnit.extend( QUnit, {
+ testSuites: function( suites ) {
+ for ( var i = 0; i < suites.length; i++ ) {
+ (function( suite ) {
+ asyncTest( suite, function() {
+ QUnit.runSuite( suite );
+ });
+ }( suites[i] ) );
+ }
+ QUnit.done = function() {
+ subsuiteFrame.style.display = "none";
+ };
+ },
+
+ testStart: function( data ) {
+ // update the test status to show which test suite is running
+ QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br>&nbsp;";
+ },
+
+ testDone: function() {
+ var current = QUnit.id( this.config.current.id ),
+ children = current.children;
+
+ // undo the auto-expansion of failed tests
+ for ( var i = 0; i < children.length; i++ ) {
+ if ( children[i].nodeName === "OL" ) {
+ children[i].style.display = "none";
+ }
+ }
+ },
+
+ runSuite: function( suite ) {
+ var body = document.getElementsByTagName( "body" )[0],
+ iframe = subsuiteFrame = document.createElement( "iframe" ),
+ iframeWin;
+
+ iframe.className = "qunit-subsuite";
+ body.appendChild( iframe );
+
+ function onIframeLoad() {
+ var module, test,
+ count = 0;
+
+ QUnit.extend( iframeWin.QUnit, {
+ moduleStart: function( data ) {
+ // capture module name for messages
+ module = data.name;
+ },
+
+ testStart: function( data ) {
+ // capture test name for messages
+ test = data.name;
+ },
+
+ log: function( data ) {
+ // pass all test details through to the main page
+ var message = module + ": " + test + ": " + data.message;
+ expect( ++count );
+ QUnit.push( data.result, data.actual, data.expected, message );
+ },
+
+ done: function() {
+ // start the wrapper test from the main page
+ start();
+ }
+ });
+ }
+ QUnit.addEvent( iframe, "load", onIframeLoad );
+
+ iframeWin = iframe.contentWindow;
+ iframe.setAttribute( "src", suite );
+
+ this.runSuite = function( suite ) {
+ iframe.setAttribute( "src", suite );
+ };
+ }
+});
+}( QUnit ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js
new file mode 100644
index 0000000..db69326
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js
@@ -0,0 +1,9 @@
+// load testswarm agent
+(function() {
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( !url || url.indexOf("http") !== 0 ) {
+ return;
+ }
+ document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
+})();
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html
new file mode 100644
index 0000000..363edc0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Tabs Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "tabs" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Tabs Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html
new file mode 100644
index 0000000..cd59e64
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html
@@ -0,0 +1 @@
+<p>&#8230;content loaded via Ajax.</p> \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html
new file mode 100644
index 0000000..f2a672b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html
@@ -0,0 +1,181 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Tabs Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script>
+ $.uiBackCompat = false;
+ </script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.tabs" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.tabs.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="tabs_defaults.js"></script>
+ <script src="tabs_core.js"></script>
+ <script src="tabs_events.js"></script>
+ <script src="tabs_methods.js"></script>
+ <script src="tabs_options.js"></script>
+
+ <script>
+ function tabs_state( tabs ) {
+ var expected = $.makeArray( arguments ).slice( 1 );
+ var actual = tabs.find( ".ui-tabs-nav li" ).map(function() {
+ var tab = $( this ),
+ panel = $( $.ui.tabs.prototype._sanitizeSelector(
+ "#" + tab.find( "a" ).attr( "aria-controls" ) ) ),
+ tabIsActive = tab.hasClass( "ui-state-active" ),
+ panelIsActive = panel.css( "display" ) !== "none";
+
+ if ( tabIsActive && panelIsActive ) {
+ return 1;
+ }
+ if ( !tabIsActive && !panelIsActive ) {
+ return 0;
+ }
+ return -1; // mixed state - invalid
+ }).get();
+ same( actual, expected );
+ }
+
+ function tabs_disabled( tabs, state ) {
+ var expected = $.map( new Array( tabs.find ( ".ui-tabs-nav li" ).length ), function( _, index ) {
+ if ( typeof state === "boolean" ) {
+ return state ? 1 : 0;
+ } else {
+ return $.inArray( index, state ) !== -1 ? 1 : 0;
+ }
+ });
+
+ var internalState = tabs.tabs( "option", "disabled" );
+ if ( internalState === false ) {
+ internalState = [];
+ }
+ if ( internalState === true ) {
+ internalState = $.map( new Array( tabs.find( ".ui-tabs-nav li" ).length ), function( _, index ) {
+ return index;
+ });
+ }
+
+ var actual = tabs.find( ".ui-tabs-nav li" ).map(function( index ) {
+ var tab = $( this ),
+ tabIsDisabled = tab.hasClass( "ui-state-disabled" );
+
+ if ( tabIsDisabled && $.inArray( index, internalState ) !== -1 ) {
+ return 1;
+ }
+ if ( !tabIsDisabled && $.inArray( index, internalState ) === -1 ) {
+ return 0;
+ }
+ return -1; // mixed state - invalid
+ }).get();
+ same( tabs.tabs( "option", "disabled" ), state );
+ same( actual, expected );
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Tabs Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="tabs1">
+ <ul>
+ <li><a href="#fragment-1"><span>1</span></a></li>
+ <li><a href="#fragment-2"><span>2</span></a></li>
+ <li><a href="#fragment-3"><span>3</span></a></li>
+ </ul>
+ <div id="fragment-1"></div>
+ <div id="fragment-2"></div>
+ <div id="fragment-3"></div>
+</div>
+
+<div id="tabs2">
+ <ul>
+ <li><a href="#colon:test"><span>1</span></a></li>
+ <li><a href="#inline-style"><span>2</span></a></li>
+ <li><a href="data/test.html#test"><span>3</span></a></li>
+ <li><a href="data/test.html" aria-controls="custom-id"><span>4</span></a></li>
+ <li><a href="data/test.html" title="∫ßáö Սե"><span>5</span></a></li>
+ </ul>
+ <div id="colon:test"></div>
+ <div style="height: 300px;" id="inline-style"></div>
+</div>
+
+<div id="tabs3">
+ <div>
+ <ul id="tabs3-list">
+ <li><a href="#tabs3-1">1</a></li>
+ </ul>
+ </div>
+</div>
+
+<div id="tabs4">
+ <ul id="tabs4-list">
+ <li><a href="#tabs4-1">1</a></li>
+ </ul>
+ <ol>
+ <li><a href="#tabs4-1">1</a></li>
+ </ol>
+</div>
+
+<div id="tabs4a">
+ <ol id="tabs4a-list">
+ <li><a href="#tabs4a-1">1</a></li>
+ </ol>
+ <ul>
+ <li><a href="#tabs4a-1">1</a></li>
+ </ul>
+</div>
+
+<div id="tabs5">
+ <div>
+ <ul id="tabs5-list"></ul>
+ </div>
+</div>
+
+<div id="tabs6">
+ <ul id="tabs6-list">
+ <li><a href="#tabs6-1">1</a>
+ <ul>
+ <li><a href="#item6-3">3</a></li>
+ <li><a href="#item6-4">4</a></li>
+ </ul>
+ </li>
+ <li><a href="#tabs6-2">2</a></li>
+ </ul>
+ <div id="tabs6-1"></div>
+ <div id="tabs6-2"></div>
+</div>
+
+<div id="tabs7">
+ <ul id="tabs7-list">
+ <li><a href="#tabs7-1">1</a></li>
+ <li><a href="#tabs7-2">2</a></li>
+ </ul>
+ <div id="tabs7-2"></div>
+ <div id="tabs7-1"></div>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js
new file mode 100644
index 0000000..e7c1ee5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js
@@ -0,0 +1,94 @@
+(function( $ ) {
+
+module( "tabs: core" );
+
+test( "markup structure", function() {
+ expect( 3 );
+ var element = $( "#tabs1" ).tabs();
+ ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
+ ok( element.find( "ul" ).hasClass( "ui-tabs-nav" ), "list item is .ui-tabs-nav" );
+ equal( element.find( ".ui-tabs-panel" ).length, 3,
+ ".ui-tabs-panel elements exist, correct number" );
+});
+
+$.each({
+ "deep ul": "#tabs3",
+ "multiple lists, ul first": "#tabs4",
+ "multiple lists, ol first": "#tabs5",
+ "empty list": "#tabs6"
+}, function( type, selector ) {
+ test( "markup structure: " + type, function() {
+ expect( 2 );
+ var element = $( selector ).tabs();
+ ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
+ ok( $( selector + "-list" ).hasClass( "ui-tabs-nav" ),
+ "list item is .ui-tabs-nav" );
+ });
+});
+
+// #5893 - Sublist in the tab list are considered as tab
+test( "nested list", function() {
+ expect( 1 );
+
+ var element = $( "#tabs6" ).tabs();
+ equals( element.data( "tabs" ).anchors.length, 2, "should contain 2 tab" );
+});
+
+test( "disconnected from DOM", function() {
+ expect( 2 );
+
+ var element = $( "#tabs1" ).remove().tabs();
+ equals( element.find( ".ui-tabs-nav" ).length, 1, "should initialize nav" );
+ equals( element.find( ".ui-tabs-panel" ).length, 3, "should initialize panels" );
+});
+
+test( "aria-controls", function() {
+ expect( 7 );
+ var element = $( "#tabs1" ).tabs(),
+ tabs = element.find( ".ui-tabs-nav a" );
+ tabs.each(function() {
+ var tab = $( this );
+ equal( tab.prop( "hash" ).substring( 1 ), tab.attr( "aria-controls" ) );
+ });
+
+ element = $( "#tabs2" ).tabs();
+ tabs = element.find( ".ui-tabs-nav a" );
+ equal( tabs.eq( 0 ).attr( "aria-controls" ), "colon:test" );
+ equal( tabs.eq( 1 ).attr( "aria-controls" ), "inline-style" );
+ ok( /^ui-tabs-\d+$/.test( tabs.eq( 2 ).attr( "aria-controls" ) ), "generated id" );
+ equal( tabs.eq( 3 ).attr( "aria-controls" ), "custom-id" );
+});
+
+test( "accessibility", function() {
+ // TODO: add tests
+});
+
+test( "#3627 - Ajax tab with url containing a fragment identifier fails to load", function() {
+ expect( 1 );
+
+ var element = $( "#tabs2" ).tabs({
+ active: 2,
+ beforeLoad: function( event, ui ) {
+ event.preventDefault();
+ ok( /test.html$/.test( ui.ajaxSettings.url ), "should ignore fragment identifier" );
+ }
+ });
+});
+
+test( "#4033 - IE expands hash to full url and misinterprets tab as ajax", function() {
+ expect( 2 );
+
+ var element = $( "<div><ul><li><a href='#tab'>Tab</a></li></ul><div id='tab'></div></div>" );
+ element.appendTo( "#main" );
+ element.tabs({
+ beforeLoad: function( event, ui ) {
+ event.preventDefault();
+ ok( false, 'should not be an ajax tab');
+ }
+ });
+
+ equals( element.find( ".ui-tabs-nav a" ).attr( "aria-controls" ), "tab", "aria-contorls attribute is correct" );
+ tabs_state( element, 1 );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js
new file mode 100644
index 0000000..52b6f8a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js
@@ -0,0 +1,16 @@
+commonWidgetTests( "tabs", {
+ defaults: {
+ active: null,
+ collapsible: false,
+ disabled: false,
+ event: "click",
+ fx: null,
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ create: null,
+ load: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js
new file mode 100644
index 0000000..1a56297
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js
@@ -0,0 +1,29 @@
+commonWidgetTests( "tabs", {
+ defaults: {
+ active: null,
+ ajaxOptions: null,
+ cache: false,
+ collapsible: false,
+ cookie: null,
+ disabled: false,
+ event: "click",
+ fx: null,
+ idPrefix: "ui-tabs-",
+ panelTemplate: "<div></div>",
+ spinner: "<em>Loading&#8230;</em>",
+ tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>",
+
+ // callbacks
+ activate: null,
+ add: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ create: null,
+ disable: null,
+ enable: null,
+ load: null,
+ remove: null,
+ select: null,
+ show: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html
new file mode 100644
index 0000000..92d9be8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html
@@ -0,0 +1,180 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Tabs Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../../external/jquery.cookie.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.tabs" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.tabs.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="tabs_defaults_deprecated.js"></script>
+ <script src="tabs_core.js"></script>
+ <script src="tabs_events.js"></script>
+ <script src="tabs_methods.js"></script>
+ <script src="tabs_options.js"></script>
+ <script src="tabs_deprecated.js"></script>
+
+ <script>
+ function tabs_state( tabs ) {
+ var expected = $.makeArray( arguments ).slice( 1 );
+ var actual = tabs.find( ".ui-tabs-nav li" ).map(function() {
+ var tab = $( this ),
+ panel = $( $.ui.tabs.prototype._sanitizeSelector(
+ "#" + tab.find( "a" ).attr( "aria-controls" ) ) ),
+ tabIsActive = tab.hasClass( "ui-state-active" ),
+ panelIsActive = panel.css( "display" ) !== "none";
+
+ if ( tabIsActive && panelIsActive ) {
+ return 1;
+ }
+ if ( !tabIsActive && !panelIsActive ) {
+ return 0;
+ }
+ return -1; // mixed state - invalid
+ }).get();
+ same( actual, expected );
+ }
+
+ function tabs_disabled( tabs, state ) {
+ var expected = $.map( new Array( tabs.find ( ".ui-tabs-nav li" ).length ), function( _, index ) {
+ if ( typeof state === "boolean" ) {
+ return state ? 1 : 0;
+ } else {
+ return $.inArray( index, state ) !== -1 ? 1 : 0;
+ }
+ });
+
+ var internalState = tabs.tabs( "option", "disabled" );
+ if ( internalState === false ) {
+ internalState = [];
+ }
+ if ( internalState === true ) {
+ internalState = $.map( new Array( tabs.find( ".ui-tabs-nav li" ).length ), function( _, index ) {
+ return index;
+ });
+ }
+
+ var actual = tabs.find( ".ui-tabs-nav li" ).map(function( index ) {
+ var tab = $( this ),
+ tabIsDisabled = tab.hasClass( "ui-state-disabled" );
+
+ if ( tabIsDisabled && $.inArray( index, internalState ) !== -1 ) {
+ return 1;
+ }
+ if ( !tabIsDisabled && $.inArray( index, internalState ) === -1 ) {
+ return 0;
+ }
+ return -1; // mixed state - invalid
+ }).get();
+ same( tabs.tabs( "option", "disabled" ), state );
+ same( actual, expected );
+ }
+ </script>
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Tabs Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="tabs1">
+ <ul>
+ <li><a href="#fragment-1"><span>1</span></a></li>
+ <li><a href="#fragment-2"><span>2</span></a></li>
+ <li><a href="#fragment-3"><span>3</span></a></li>
+ </ul>
+ <div id="fragment-1"></div>
+ <div id="fragment-2"></div>
+ <div id="fragment-3"></div>
+</div>
+
+<div id="tabs2">
+ <ul>
+ <li><a href="#colon:test"><span>1</span></a></li>
+ <li><a href="#inline-style"><span>2</span></a></li>
+ <li><a href="data/test.html#test"><span>3</span></a></li>
+ <li><a href="data/test.html" aria-controls="custom-id"><span>4</span></a></li>
+ <li><a href="data/test.html" title="∫ßáö Սե"><span>5</span></a></li>
+ </ul>
+ <div id="colon:test"></div>
+ <div style="height: 300px;" id="inline-style"></div>
+</div>
+
+<div id="tabs3">
+ <div>
+ <ul id="tabs3-list">
+ <li><a href="#tabs3-1">1</a></li>
+ </ul>
+ </div>
+</div>
+
+<div id="tabs4">
+ <ul id="tabs4-list">
+ <li><a href="#tabs4-1">1</a></li>
+ </ul>
+ <ol>
+ <li><a href="#tabs4-1">1</a></li>
+ </ol>
+</div>
+
+<div id="tabs4a">
+ <ol id="tabs4a-list">
+ <li><a href="#tabs4a-1">1</a></li>
+ </ol>
+ <ul>
+ <li><a href="#tabs4a-1">1</a></li>
+ </ul>
+</div>
+
+<div id="tabs5">
+ <div>
+ <ul id="tabs5-list"></ul>
+ </div>
+</div>
+
+<div id="tabs6">
+ <ul id="tabs6-list">
+ <li><a href="#tabs6-1">1</a>
+ <ul>
+ <li><a href="#item6-3">3</a></li>
+ <li><a href="#item6-4">4</a></li>
+ </ul>
+ </li>
+ <li><a href="#tabs6-2">2</a></li>
+ </ul>
+ <div id="tabs6-1"></div>
+ <div id="tabs6-2"></div>
+</div>
+
+<div id="tabs7">
+ <ul id="tabs7-list">
+ <li><a href="#tabs7-1">1</a></li>
+ <li><a href="#tabs7-2">2</a></li>
+ </ul>
+ <div id="tabs7-2"></div>
+ <div id="tabs7-1"></div>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js
new file mode 100644
index 0000000..1323c77
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js
@@ -0,0 +1,576 @@
+(function( $ ) {
+
+module( "tabs (deprecated): core" );
+
+test( "panel ids", function() {
+ expect( 2 );
+
+ var element = $( "#tabs2" ).tabs();
+
+ element.one( "tabsbeforeload", function( event, ui ) {
+ equal( ui.panel.attr( "id" ), "∫ßáö_Սե", "from title attribute" );
+ event.preventDefault();
+ });
+ element.tabs( "option", "active", 4 );
+
+ element.one( "tabsbeforeload", function( event, ui ) {
+ ok( /^ui-tabs-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" );
+ event.preventDefault();
+ });
+ element.tabs( "option", "active", 2 );
+});
+
+module( "tabs (deprecated): options" );
+
+asyncTest( "ajaxOptions", function() {
+ expect( 1 );
+
+ var element = $( "#tabs2" ).tabs({
+ ajaxOptions: {
+ converters: {
+ "text html": function() {
+ return "test";
+ }
+ }
+ }
+ });
+ element.one( "tabsload", function( event, ui ) {
+ equals( $( ui.panel ).html(), "test" );
+ start();
+ });
+ element.tabs( "option", "active", 2 );
+});
+
+asyncTest( "cache", function() {
+ expect( 5 );
+
+ var element = $( "#tabs2" ).tabs({
+ cache: true
+ });
+ element.one( "tabsshow", function( event, ui ) {
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ ok( true, "tabsload" );
+
+ setTimeout(function() {
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+
+ element.one( "tabsshow", function( event, ui ) {
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ ok( false, "should be cached" );
+ });
+ element.tabs( "option", "active", 2 );
+ start();
+ }, 1 );
+ });
+ element.tabs( "option", "active", 2 );
+ tabs_state( element, 0, 0, 1, 0, 0 );
+});
+
+test( "idPrefix", function() {
+ expect( 1 );
+
+ $( "#tabs2" )
+ .one( "tabsbeforeload", function( event, ui ) {
+ ok( /^testing-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" );
+ event.preventDefault();
+ })
+ .tabs({
+ idPrefix: "testing-",
+ active: 2
+ });
+});
+
+test( "tabTemplate + panelTemplate", function() {
+ // defaults are tested in the add method test
+ expect( 11 );
+
+ var element = $( "#tabs2" ).tabs({
+ tabTemplate: "<li class='customTab'><a href='http://example.com/#{href}'>#{label}</a></li>",
+ panelTemplate: "<div class='customPanel'></div>"
+ });
+ element.one( "tabsadd", function( event, ui ) {
+ var anchor = $( ui.tab );
+ equal( ui.index, 5, "ui.index" );
+ equal( anchor.text(), "New", "ui.tab" );
+ equal( anchor.attr( "href" ), "http://example.com/#new", "tab href" );
+ ok( anchor.parent().hasClass( "customTab" ), "tab custom class" );
+ equal( ui.panel.id, "new", "ui.panel" );
+ ok( $( ui.panel ).hasClass( "customPanel" ), "panel custom class" );
+ });
+ element.tabs( "add", "#new", "New" );
+ var tab = element.find( ".ui-tabs-nav li" ).last(),
+ anchor = tab.find( "a" );
+ equals( tab.text(), "New", "label" );
+ ok( tab.hasClass( "customTab" ), "tab custom class" );
+ equals( anchor.attr( "href" ), "http://example.com/#new", "href" );
+ equals( anchor.attr( "aria-controls" ), "new", "aria-controls" );
+ ok( element.find( "#new" ).hasClass( "customPanel" ), "panel custom class" );
+});
+
+test( "cookie", function() {
+ expect( 6 );
+
+ var element = $( "#tabs1" ),
+ cookieName = "tabs_test",
+ cookieObj = { name: cookieName };
+ $.cookie( cookieName, null );
+ function cookie() {
+ return parseInt( $.cookie( cookieName ), 10 );
+ }
+
+ element.tabs({ cookie: cookieObj });
+ equals( cookie(), 0, "initial cookie value" );
+
+ element.tabs( "destroy" );
+ element.tabs({ active: 1, cookie: cookieObj });
+ equals( cookie(), 1, "initial cookie value, from active property" );
+
+ element.tabs( "option", "active", 2 );
+ equals( cookie(), 2, "cookie value updated after activating" );
+
+ element.tabs( "destroy" );
+ $.cookie( cookieName, 1 );
+ element.tabs({ cookie: cookieObj });
+ equals( cookie(), 1, "initial cookie value, from existing cookie" );
+
+ element.tabs( "destroy" );
+ element.tabs({ cookie: cookieObj, collapsible: true });
+ element.tabs( "option", "active", false );
+ equals( cookie(), -1, "cookie value for all tabs unselected" );
+
+ element.tabs( "destroy" );
+ ok( $.cookie( cookieName ) === null, "erase cookie after destroy" );
+});
+
+asyncTest( "spinner", function() {
+ expect( 2 );
+
+ var element = $( "#tabs2" ).tabs();
+
+ element.one( "tabsbeforeload", function( event, ui ) {
+ equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 1, "beforeload" );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ // wait until after the load finishes before checking for the spinner to be removed
+ setTimeout(function() {
+ equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 0, "load" );
+ start();
+ }, 1 );
+ });
+ element.tabs( "option", "active", 2 );
+});
+
+test( "selected", function() {
+ expect( 19 );
+
+ var element = $( "#tabs1" ).tabs();
+ equals( element.tabs( "option", "selected" ), 0, "should be 0 by default" );
+ tabs_state( element, 1, 0, 0 );
+ element.tabs( "destroy" );
+
+ location.hash = "#fragment-3";
+ element = $( "#tabs1" ).tabs();
+ equals( element.tabs( "option", "selected" ), 2, "should be 2 based on URL" );
+ tabs_state( element, 0, 0, 1 );
+ element.tabs( "destroy" );
+
+ el = $('#tabs1').tabs({
+ selected: -1,
+ collapsible: true
+ });
+ tabs_state( element, 0, 0, 0 );
+ equal( element.find( ".ui-tabs-nav .ui-state-active" ).size(), 0, "no tabs selected" );
+ strictEqual( element.tabs( "option", "selected" ), -1 );
+
+ element.tabs( "option", "collapsible", false );
+ tabs_state( element, 1, 0, 0 );
+ equal( element.tabs( "option", "selected" ), 0 );
+ element.tabs( "destroy" );
+
+ element.tabs({
+ selected: -1
+ });
+ tabs_state( element, 1, 0, 0 );
+ strictEqual( element.tabs( "option", "selected" ), 0 );
+ element.tabs( "destroy" );
+
+ element.tabs({ selected: 2 });
+ equals( element.tabs( "option", "selected" ), 2 );
+ tabs_state( element, 0, 0, 1 );
+
+ element.tabs( "option", "selected", 0 );
+ equals( element.tabs( "option", "selected" ), 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ element.find( ".ui-tabs-nav a" ).eq( 1 ).click();
+ equals( element.tabs( "option", "selected" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.tabs( "option", "selected", 10 );
+ equals( element.tabs( "option", "selected" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ location.hash = "#";
+});
+
+module( "tabs (deprecated): events" );
+
+asyncTest( "load", function() {
+ expect( 15 );
+
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
+
+ // init
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ tabsload1();
+ });
+ element.tabs({ active: 2 });
+
+ function tabsload1() {
+ // .option()
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ tabsload2();
+ });
+ element.tabs( "option", "active", 3 );
+ }
+
+ function tabsload2() {
+ // click, change panel content
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 4 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 0, 1 );
+ start();
+ });
+ element.find( ".ui-tabs-nav a" ).eq( 4 ).click();
+ }
+});
+
+test( "enable", function() {
+ expect( 3 );
+
+ var element = $( "#tabs1" ).tabs({
+ disabled: [ 0, 1 ],
+ enable: function ( event, ui ) {
+ equals( ui.tab, element.find( ".ui-tabs-nav a" )[ 1 ], "ui.tab" );
+ equals( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
+ equals( ui.index, 1, "ui.index" );
+ }
+ });
+ element.tabs( "enable", 1 );
+ // shouldn't trigger event
+ element.tabs( "enable", 2 );
+});
+
+test( "disable", function() {
+ expect( 3 );
+
+ var element = $( "#tabs1" ).tabs({
+ disable: function ( event, ui ) {
+ equals( ui.tab, element.find( ".ui-tabs-nav a" )[ 1 ], "ui.tab" );
+ equals( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
+ equals( ui.index, 1, "ui.index" );
+ }
+ });
+ element.tabs( "disable", 1 );
+ // shouldn't trigger event
+ element.tabs( "disable", 1 );
+});
+
+
+test( "show", function() {
+ expect( 13 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: false,
+ collapsible: true
+ }),
+ tabs = element.find( ".ui-tabs-nav a" ),
+ panels = element.find( ".ui-tabs-panel" );
+
+ // from collapsed
+ element.one( "tabsshow", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tabs[ 0 ], "ui.tab" );
+ strictEqual( ui.panel, panels[ 0 ], "ui.panel" );
+ equal( ui.index, 0, "ui.index" );
+ tabs_state( element, 1, 0, 0 );
+ });
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ // switching tabs
+ element.one( "tabsshow", function( event, ui ) {
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ strictEqual( ui.tab, tabs[ 1 ], "ui.tab" );
+ strictEqual( ui.panel, panels[ 1 ], "ui.panel" );
+ equal( ui.index, 1, "ui.index" );
+ tabs_state( element, 0, 1, 0 );
+ });
+ tabs.eq( 1 ).click();
+ tabs_state( element, 0, 1, 0 );
+
+ // collapsing
+ element.one( "tabsshow", function( event, ui ) {
+ ok( false, "collapsing" );
+ });
+ element.tabs( "option", "active", false );
+ tabs_state( element, 0, 0, 0 );
+});
+
+test( "select", function() {
+ expect( 13 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: false,
+ collapsible: true
+ }),
+ tabs = element.find( ".ui-tabs-nav a" ),
+ panels = element.find( ".ui-tabs-panel" );
+
+ // from collapsed
+ element.one( "tabsselect", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tabs[ 0 ], "ui.tab" );
+ strictEqual( ui.panel, panels[ 0 ], "ui.panel" );
+ equal( ui.index, 0, "ui.index" );
+ tabs_state( element, 0, 0, 0 );
+ });
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ // switching tabs
+ element.one( "tabsselect", function( event, ui ) {
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ strictEqual( ui.tab, tabs[ 1 ], "ui.tab" );
+ strictEqual( ui.panel, panels[ 1 ], "ui.panel" );
+ equal( ui.index, 1, "ui.index" );
+ tabs_state( element, 1, 0, 0 );
+ });
+ tabs.eq( 1 ).click();
+ tabs_state( element, 0, 1, 0 );
+
+ // collapsing
+ element.one( "tabsselect", function( event, ui ) {
+ ok( false, "collapsing" );
+ });
+ element.tabs( "option", "active", false );
+ tabs_state( element, 0, 0, 0 );
+});
+
+module( "tabs (deprecated): methods" );
+
+test( "add", function() {
+ expect( 27 );
+
+ var element = $( "#tabs1" ).tabs();
+ tabs_state( element, 1, 0, 0 );
+
+ // add without index
+ element.one( "tabsadd", function( event, ui ) {
+ equal( ui.index, 3, "ui.index" );
+ equal( $( ui.tab ).text(), "New", "ui.tab" );
+ equal( ui.panel.id, "new", "ui.panel" );
+ });
+ element.tabs( "add", "#new", "New" );
+ tabs_state( element, 1, 0, 0, 0 );
+ var tab = element.find( ".ui-tabs-nav li" ).last(),
+ anchor = tab.find( "a" );
+ equals( tab.text(), "New", "label" );
+ equals( anchor.attr( "href" ), "#new", "href" );
+ equals( anchor.attr( "aria-controls" ), "new", "aria-controls" );
+ ok( !tab.hasClass( "ui-state-hover" ), "not hovered" );
+ anchor.simulate( "mouseover" );
+ ok( tab.hasClass( "ui-state-hover" ), "hovered" );
+ anchor.simulate( "click" );
+ tabs_state( element, 0, 0, 0, 1 );
+
+ // add remote tab with index
+ element.one( "tabsadd", function( event, ui ) {
+ equal( ui.index, 1, "ui.index" );
+ equal( $( ui.tab ).text(), "New Remote", "ui.tab" );
+ equal( ui.panel.id, $( ui.tab ).attr( "aria-controls" ), "ui.panel" );
+ });
+ element.tabs( "add", "data/test.html", "New Remote", 1 );
+ tabs_state( element, 0, 0, 0, 0, 1 );
+ tab = element.find( ".ui-tabs-nav li" ).eq( 1 );
+ anchor = tab.find( "a" );
+ equals( tab.text(), "New Remote", "label" );
+ equals( anchor.attr( "href" ), "data/test.html", "href" );
+ ok( /^ui-tabs-\d+$/.test( anchor.attr( "aria-controls" ) ), "aria controls" );
+ ok( !tab.hasClass( "ui-state-hover" ), "not hovered" );
+ anchor.simulate( "mouseover" );
+ ok( tab.hasClass( "ui-state-hover" ), "hovered" );
+ anchor.simulate( "click" );
+ tabs_state( element, 0, 1, 0, 0, 0 );
+
+ // add to empty tab set
+ element = $( "<div><ul></ul></div>" ).tabs();
+ equals( element.tabs( "option", "active" ), false, "active: false on init" );
+ element.one( "tabsadd", function( event, ui ) {
+ equal( ui.index, 0, "ui.index" );
+ equal( $( ui.tab ).text(), "First", "ui.tab" );
+ equal( ui.panel.id, "first", "ui.panel" );
+ });
+ element.tabs( "add", "#first", "First" );
+ tabs_state( element, 1 );
+ equals( element.tabs( "option", "active" ), 0, "active: 0 after add" );
+});
+
+test( "#5069 - ui.tabs.add creates two tab panels when using a full URL", function() {
+ expect( 2 );
+
+ var element = $( "#tabs2" ).tabs();
+ equals( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length );
+ element.tabs( "add", "/new", "New" );
+ equals( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length );
+});
+
+test( "remove", function() {
+ expect( 17 );
+
+ var element = $( "#tabs1" ).tabs({ active: 1 });
+ tabs_state( element, 0, 1, 0 );
+
+ element.one( "tabsremove", function( event, ui ) {
+ equal( ui.index, -1, "ui.index" );
+ equal( $( ui.tab ).text(), "2", "ui.tab" );
+ equal( ui.panel.id, "fragment-2", "ui.panel" );
+ });
+ element.tabs( "remove", 1 );
+ tabs_state( element, 0, 1 );
+ equals( element.tabs( "option", "active" ), 1 );
+ equals( element.find( ".ui-tabs-nav li a[href$='fragment-2']" ).length, 0,
+ "remove correct list item" );
+ equals( element.find( "#fragment-2" ).length, 0, "remove correct panel" );
+
+ element.one( "tabsremove", function( event, ui ) {
+ equal( ui.index, -1, "ui.index" );
+ equal( $( ui.tab ).text(), "3", "ui.tab" );
+ equal( ui.panel.id, "fragment-3", "ui.panel" );
+ });
+ element.tabs( "remove", 1 );
+ tabs_state( element, 1 );
+ equals( element.tabs( "option", "active"), 0 );
+
+ element.one( "tabsremove", function( event, ui ) {
+ equal( ui.index, -1, "ui.index" );
+ equal( $( ui.tab ).text(), "1", "ui.tab" );
+ equal( ui.panel.id, "fragment-1", "ui.panel" );
+ });
+ element.tabs( "remove", 0 );
+ equals( element.tabs( "option", "active" ), false );
+});
+
+test( "select", function() {
+ expect( 23 );
+
+ var element = $( "#tabs1" ).tabs();
+ tabs_state( element, 1, 0, 0 );
+ element.tabs( "select", 1 );
+ tabs_state( element, 0, 1, 0 );
+ equals( element.tabs( "option", "active" ), 1, "active" );
+ equals( element.tabs( "option", "selected" ), 1, "selected" );
+ element.tabs( "destroy" );
+
+ element.tabs({ collapsible: true });
+ tabs_state( element, 1, 0, 0 );
+ element.tabs( "select", 0 );
+ tabs_state( element, 0, 0, 0 );
+ equals( element.tabs( "option", "active" ), false, "active" );
+ equals( element.tabs( "option", "selected" ), -1, "selected" );
+ element.tabs( "destroy" );
+
+ element.tabs({ collapsible: true });
+ element.tabs( "select", -1 );
+ tabs_state( element, 0, 0, 0 );
+ equals( element.tabs( "option", "active" ), false, "active" );
+ equals( element.tabs( "option", "selected" ), -1, "selected" );
+ element.tabs( "destroy" );
+
+ element.tabs();
+ tabs_state( element, 1, 0, 0 );
+ equals( element.tabs( "option", "active" ), 0, "active" );
+ equals( element.tabs( "option", "selected" ), 0, "selected" );
+ element.tabs( "select", 0 );
+ tabs_state( element, 1, 0, 0 );
+ equals( element.tabs( "option", "active" ), 0, "active" );
+ equals( element.tabs( "option", "selected" ), 0, "selected" );
+ element.tabs( "select", -1 );
+ tabs_state( element, 1, 0, 0 );
+ equals( element.tabs( "option", "active" ), 0, "active" );
+ equals( element.tabs( "option", "selected" ), 0, "selected" );
+
+ element.tabs( "select", "#fragment-2" );
+ tabs_state( element, 0, 1, 0 );
+ equals( element.tabs( "option", "active" ), 1, "active" );
+ equals( element.tabs( "option", "selected" ), 1, "selected" );
+});
+
+test( "length", function() {
+ expect( 2 );
+
+ equals( $( "#tabs1" ).tabs().tabs( "length" ), 3, "basic tabs" );
+ equals( $( "#tabs2" ).tabs().tabs( "length" ), 5, "ajax tabs with missing panels" );
+});
+
+test( "url", function() {
+ expect( 2 );
+
+ var element = $( "#tabs2" ).tabs(),
+ tab = element.find( "a" ).eq( 3 );
+
+ element.tabs( "url", 3, "data/test2.html" );
+ equals( tab.attr( "href" ), "data/test2.html", "href was updated" );
+ element.one( "tabsbeforeload", function( event, ui ) {
+ equals( ui.ajaxSettings.url, "data/test2.html", "ajaxSettings.url" );
+ event.preventDefault();
+ });
+ element.tabs( "option", "active", 3 );
+});
+
+asyncTest( "abort", function() {
+ expect( 1 );
+
+ var element = $( "#tabs2" ).tabs();
+ element.one( "tabsbeforeload", function( event, ui ) {
+ ui.jqXHR.error(function( jqXHR, status ) {
+ equals( status, "abort", "aborted" );
+ start();
+ });
+ });
+ element.tabs( "option", "active", 2 );
+ element.tabs( "abort" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js
new file mode 100644
index 0000000..f5cde18
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js
@@ -0,0 +1,277 @@
+(function( $ ) {
+
+module( "tabs: events" );
+
+test( "beforeActivate", function() {
+ expect( 38 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: false,
+ collapsible: true
+ }),
+ tabs = element.find( ".ui-tabs-nav a" ),
+ panels = element.find( ".ui-tabs-panel" );
+
+ // from collapsed
+ element.one( "tabsbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.oldTab.size(), 0, "oldTab size" );
+ equals( ui.oldPanel.size(), 0, "oldPanel size" );
+ equals( ui.newTab.size(), 1, "newTab size" );
+ strictEqual( ui.newTab[ 0 ], tabs[ 0 ], "newTab" );
+ equals( ui.newPanel.size(), 1, "newPanel size" );
+ strictEqual( ui.newPanel[ 0 ], panels[ 0 ], "newPanel" );
+ tabs_state( element, 0, 0, 0 );
+ });
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ // switching tabs
+ element.one( "tabsbeforeactivate", function( event, ui ) {
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ equals( ui.oldTab.size(), 1, "oldTab size" );
+ strictEqual( ui.oldTab[ 0 ], tabs[ 0 ], "oldTab" );
+ equals( ui.oldPanel.size(), 1, "oldPanel size" );
+ strictEqual( ui.oldPanel[ 0 ], panels[ 0 ], "oldPanel" );
+ equals( ui.newTab.size(), 1, "newTab size" );
+ strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" );
+ equals( ui.newPanel.size(), 1, "newPanel size" );
+ strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" );
+ tabs_state( element, 1, 0, 0 );
+ });
+ tabs.eq( 1 ).click();
+ tabs_state( element, 0, 1, 0 );
+
+ // collapsing
+ element.one( "tabsbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.oldTab.size(), 1, "oldTab size" );
+ strictEqual( ui.oldTab[ 0 ], tabs[ 1 ], "oldTab" );
+ equals( ui.oldPanel.size(), 1, "oldPanel size" );
+ strictEqual( ui.oldPanel[ 0 ], panels[ 1 ], "oldPanel" );
+ equals( ui.newTab.size(), 0, "newTab size" );
+ equals( ui.newPanel.size(), 0, "newPanel size" );
+ tabs_state( element, 0, 1, 0 );
+ });
+ element.tabs( "option", "active", false );
+ tabs_state( element, 0, 0, 0 );
+
+ // prevent activation
+ element.one( "tabsbeforeactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.oldTab.size(), 0, "oldTab size" );
+ equals( ui.oldPanel.size(), 0, "oldTab" );
+ equals( ui.newTab.size(), 1, "newTab size" );
+ strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" );
+ equals( ui.newPanel.size(), 1, "newPanel size" );
+ strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" );
+ event.preventDefault();
+ tabs_state( element, 0, 0, 0 );
+ });
+ element.tabs( "option", "active", 1 );
+ tabs_state( element, 0, 0, 0 );
+});
+
+test( "activate", function() {
+ expect( 30 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: false,
+ collapsible: true
+ }),
+ tabs = element.find( ".ui-tabs-nav a" ),
+ panels = element.find( ".ui-tabs-panel" );
+
+ // from collapsed
+ element.one( "tabsactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.oldTab.size(), 0, "oldTab size" );
+ equals( ui.oldPanel.size(), 0, "oldPanel size" );
+ equals( ui.newTab.size(), 1, "newTab size" );
+ strictEqual( ui.newTab[ 0 ], tabs[ 0 ], "newTab" );
+ equals( ui.newPanel.size(), 1, "newPanel size" );
+ strictEqual( ui.newPanel[ 0 ], panels[ 0 ], "newPanel" );
+ tabs_state( element, 1, 0, 0 );
+ });
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ // switching tabs
+ element.one( "tabsactivate", function( event, ui ) {
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ equals( ui.oldTab.size(), 1, "oldTab size" );
+ strictEqual( ui.oldTab[ 0 ], tabs[ 0 ], "oldTab" );
+ equals( ui.oldPanel.size(), 1, "oldPanel size" );
+ strictEqual( ui.oldPanel[ 0 ], panels[ 0 ], "oldPanel" );
+ equals( ui.newTab.size(), 1, "newTab size" );
+ strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" );
+ equals( ui.newPanel.size(), 1, "newPanel size" );
+ strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" );
+ tabs_state( element, 0, 1, 0 );
+ });
+ tabs.eq( 1 ).click();
+ tabs_state( element, 0, 1, 0 );
+
+ // collapsing
+ element.one( "tabsactivate", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.oldTab.size(), 1, "oldTab size" );
+ strictEqual( ui.oldTab[ 0 ], tabs[ 1 ], "oldTab" );
+ equals( ui.oldPanel.size(), 1, "oldPanel size" );
+ strictEqual( ui.oldPanel[ 0 ], panels[ 1 ], "oldPanel" );
+ equals( ui.newTab.size(), 0, "newTab size" );
+ equals( ui.newPanel.size(), 0, "newPanel size" );
+ tabs_state( element, 0, 0, 0 );
+ });
+ element.tabs( "option", "active", false );
+ tabs_state( element, 0, 0, 0 );
+
+ // prevent activation
+ element.one( "tabsbeforeactivate", function( event ) {
+ ok( true, "tabsbeforeactivate" );
+ event.preventDefault();
+ });
+ element.one( "tabsactivate", function() {
+ ok( false, "tabsactivate" );
+ });
+ element.tabs( "option", "active", 1 );
+});
+
+test( "beforeLoad", function() {
+ expect( 32 );
+
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
+
+ // init
+ element.one( "tabsbeforeload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ ok( "abort" in ui.jqXHR, "jqXHR" );
+ ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.html(), "", "panel html" );
+ event.preventDefault();
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ });
+ element.tabs({ active: 2 });
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ equals( panel.html(), "", "panel html after" );
+ element.tabs( "destroy" );
+
+ // .option()
+ element.one( "tabsbeforeload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ ok( "abort" in ui.jqXHR, "jqXHR" );
+ ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.html(), "", "panel html" );
+ event.preventDefault();
+ tabs_state( element, 1, 0, 0, 0, 0 );
+ });
+ element.tabs();
+ element.tabs( "option", "active", 2 );
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ equals( panel.html(), "", "panel html after" );
+
+ // click, change panel content
+ element.one( "tabsbeforeload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ ok( "abort" in ui.jqXHR, "jqXHR" );
+ ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ ui.panel.html( "<p>testing</p>" );
+ event.preventDefault();
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ });
+ element.find( ".ui-tabs-nav a" ).eq( 3 ).click();
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ // .toLowerCase() is needed to convert <P> to <p> in old IEs
+ equals( panel.html().toLowerCase(), "<p>testing</p>", "panel html after" );
+});
+
+if ( $.uiBackCompat === false ) {
+ asyncTest( "load", function() {
+ expect( 21 );
+
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
+
+ // init
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ tabsload1();
+ });
+ element.tabs({ active: 2 });
+
+ function tabsload1() {
+ // .option()
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ tabsload2();
+ });
+ element.tabs( "option", "active", 3 );
+ }
+
+ function tabsload2() {
+ // click, change panel content
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 4 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 0, 1 );
+ start();
+ });
+ element.find( ".ui-tabs-nav a" ).eq( 4 ).click();
+ }
+ });
+}
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js
new file mode 100644
index 0000000..b62f7bb
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js
@@ -0,0 +1,237 @@
+(function( $ ) {
+
+module( "tabs: methods" );
+
+test( "destroy", function() {
+ domEqual( "#tabs1", function() {
+ $( "#tabs1" ).tabs().tabs( "destroy" );
+ });
+});
+
+test( "enable", function() {
+ expect( 8 );
+
+ var element = $( "#tabs1" ).tabs({ disabled: true });
+ tabs_disabled( element, true );
+ element.tabs( "enable" );
+ tabs_disabled( element, false );
+ element.tabs( "destroy" );
+
+ element.tabs({ disabled: [ 0, 1 ] });
+ tabs_disabled( element, [ 0, 1 ] );
+ element.tabs( "enable" );
+ tabs_disabled( element, false );
+});
+
+test( "enable( index )", function() {
+ expect( 10 );
+
+ var element = $( "#tabs1" ).tabs({ disabled: true });
+ tabs_disabled( element, true );
+ // fully disabled -> partially disabled
+ element.tabs( "enable", 1 );
+ tabs_disabled( element, [ 0, 2 ] );
+ // partially disabled -> partially disabled
+ element.tabs( "enable", 2 );
+ tabs_disabled( element, [ 0 ] );
+ // already enabled tab, no change
+ element.tabs( "enable", 2 );
+ tabs_disabled( element, [ 0 ] );
+ // partially disabled -> fully enabled
+ element.tabs( "enable", 0 );
+ tabs_disabled( element, false );
+});
+
+test( "disable", function() {
+ expect( 8 );
+
+ var element = $( "#tabs1" ).tabs({ disabled: false });
+ tabs_disabled( element, false );
+ element.tabs( "disable" );
+ tabs_disabled( element, true );
+ element.tabs( "destroy" );
+
+ element.tabs({ disabled: [ 0, 1 ] });
+ tabs_disabled( element, [ 0, 1 ] );
+ element.tabs( "disable" );
+ tabs_disabled( element, true );
+});
+
+test( "disable( index )", function() {
+ expect( 10 );
+
+ var element = $( "#tabs1" ).tabs({ disabled: false });
+ tabs_disabled( element, false );
+ // fully enabled -> partially disabled
+ element.tabs( "disable", 1 );
+ tabs_disabled( element, [ 1 ] );
+ // partially disabled -> partially disabled
+ element.tabs( "disable", 2 );
+ tabs_disabled( element, [ 1, 2 ] );
+ // already disabled tab, no change
+ element.tabs( "disable", 2 );
+ tabs_disabled( element, [ 1, 2 ] );
+ // partially disabled -> fully disabled
+ element.tabs( "disable", 0 );
+ tabs_disabled( element, true );
+});
+
+test( "refresh", function() {
+ expect( 27 );
+
+ var element = $( "#tabs1" ).tabs();
+ tabs_state( element, 1, 0, 0 );
+ tabs_disabled( element, false );
+
+ // disable tab via markup
+ element.find( ".ui-tabs-nav li" ).eq( 1 ).addClass( "ui-state-disabled" );
+ element.tabs( "refresh" );
+ tabs_state( element, 1, 0, 0 );
+ tabs_disabled( element, [ 1 ] );
+
+ // add remote tab
+ element.find( ".ui-tabs-nav" ).append( "<li id='newTab'><a href='data/test.html'>new</a></li>" );
+ element.tabs( "refresh" );
+ tabs_state( element, 1, 0, 0, 0 );
+ tabs_disabled( element, [ 1 ] );
+ equals( element.find( "#" + $( "#newTab a" ).attr( "aria-controls" ) ).length, 1,
+ "panel added for remote tab" );
+
+ // remove all tabs
+ element.find( ".ui-tabs-nav li, .ui-tabs-panel" ).remove();
+ element.tabs( "refresh" );
+ tabs_state( element );
+ equals( element.tabs( "option", "active" ), false, "no active tab" );
+
+ // add tabs
+ element.find( ".ui-tabs-nav" )
+ .append( "<li class='ui-state-disabled'><a href='#newTab2'>new 2</a></li>" )
+ .append( "<li><a href='#newTab3'>new 3</a></li>" )
+ .append( "<li><a href='#newTab4'>new 4</a></li>" )
+ .append( "<li><a href='#newTab5'>new 5</a></li>" );
+ element
+ .append( "<div id='newTab2'>new 2</div>" )
+ .append( "<div id='newTab3'>new 3</div>" )
+ .append( "<div id='newTab4'>new 4</div>" )
+ .append( "<div id='newTab5'>new 5</div>" );
+ element.tabs( "refresh" );
+ tabs_state( element, 0, 0, 0, 0 );
+ tabs_disabled( element, [ 0 ] );
+
+ // activate third tab
+ element.tabs( "option", "active", 2 );
+ tabs_state( element, 0, 0, 1, 0 );
+ tabs_disabled( element, [ 0 ] );
+
+ // remove fourth tab, third tab should stay active
+ element.find( ".ui-tabs-nav li" ).eq( 3 ).remove();
+ element.find( ".ui-tabs-panel" ).eq( 3 ).remove();
+ element.tabs( "refresh" );
+ tabs_state( element, 0, 0, 1 );
+ tabs_disabled( element, [ 0 ] );
+
+ // remove third (active) tab, second tab should become active
+ element.find( ".ui-tabs-nav li" ).eq( 2 ).remove();
+ element.find( ".ui-tabs-panel" ).eq( 2 ).remove();
+ element.tabs( "refresh" );
+ tabs_state( element, 0, 1 );
+ tabs_disabled( element, [ 0 ] );
+
+ // remove first tab, previously active tab (now first) should stay active
+ element.find( ".ui-tabs-nav li" ).eq( 0 ).remove();
+ element.find( ".ui-tabs-panel" ).eq( 0 ).remove();
+ element.tabs( "refresh" );
+ tabs_state( element, 1 );
+ tabs_disabled( element, false );
+});
+
+asyncTest( "load", function() {
+ expect( 30 );
+
+ var element = $( "#tabs2" ).tabs();
+
+ // load content of inactive tab
+ // useful for preloading content with custom caching
+ element.one( "tabsbeforeload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ // TODO: remove wrapping in 2.0
+ var uiTab = $( ui.tab ),
+ uiPanel = $( ui.panel );
+
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( uiTab.size(), 1, "tab size" );
+ strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" );
+ equals( uiPanel.size(), 1, "panel size" );
+ strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" );
+ equals( uiPanel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+ setTimeout( tabsload1, 100 );
+ });
+ element.tabs( "load", 3 );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+
+ function tabsload1() {
+ // no need to test details of event (tested in events tests)
+ element.one( "tabsbeforeload", function() {
+ ok( true, "tabsbeforeload invoked" );
+ });
+ element.one( "tabsload", function() {
+ ok( true, "tabsload invoked" );
+ setTimeout( tabsload2, 100 );
+ });
+ element.tabs( "option", "active", 3 );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ }
+
+ function tabsload2() {
+ // reload content of active tab
+ element.one( "tabsbeforeload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ // TODO: remove wrapping in 2.0
+ var uiTab = $( ui.tab ),
+ uiPanel = $( ui.panel );
+
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( uiTab.size(), 1, "tab size" );
+ strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" );
+ equals( uiPanel.size(), 1, "panel size" );
+ strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ start();
+ });
+ element.tabs( "load", 3 );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ }
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js
new file mode 100644
index 0000000..8d61c47
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js
@@ -0,0 +1,213 @@
+(function( $ ) {
+
+module( "tabs: options" );
+
+test( "{ active: default }", function() {
+ expect( 4 );
+
+ var element = $( "#tabs1" ).tabs();
+ equals( element.tabs( "option", "active" ), 0, "should be 0 by default" );
+ tabs_state( element, 1, 0, 0 );
+ element.tabs( "destroy" );
+
+ location.hash = "#fragment-3";
+ element = $( "#tabs1" ).tabs();
+ equals( element.tabs( "option", "active" ), 2, "should be 2 based on URL" );
+ tabs_state( element, 0, 0, 1 );
+ element.tabs( "destroy" );
+ location.hash = "#";
+});
+
+test( "{ active: false }", function() {
+ expect( 7 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: false,
+ collapsible: true
+ });
+ tabs_state( element, 0, 0, 0 );
+ equal( element.find( ".ui-tabs-nav .ui-state-active" ).size(), 0, "no tabs selected" );
+ strictEqual( element.tabs( "option", "active" ), false );
+
+ element.tabs( "option", "collapsible", false );
+ tabs_state( element, 1, 0, 0 );
+ equal( element.tabs( "option", "active" ), 0 );
+
+ element.tabs( "destroy" );
+ element.tabs({
+ active: false
+ });
+ tabs_state( element, 1, 0, 0 );
+ strictEqual( element.tabs( "option", "active" ), 0 );
+});
+
+test( "{ active: Number }", function() {
+ expect( 8 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: 2
+ });
+ equals( element.tabs( "option", "active" ), 2 );
+ tabs_state( element, 0, 0, 1 );
+
+ element.tabs( "option", "active", 0 );
+ equals( element.tabs( "option", "active" ), 0 );
+ tabs_state( element, 1, 0, 0 );
+
+ element.find( ".ui-tabs-nav a" ).eq( 1 ).click();
+ equals( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.tabs( "option", "active", 10 );
+ equals( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+});
+
+if ( $.uiBackCompat === false ) {
+ test( "{ active: -Number }", function() {
+ var element = $( "#tabs1" ).tabs({
+ active: -1
+ });
+ equals( element.tabs( "option", "active" ), 2 );
+ tabs_state( element, 0, 0, 1 );
+
+ element.tabs( "option", "active", -2 );
+ equals( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.tabs( "option", "active", -10 );
+ equals( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.tabs( "option", "active", -3 );
+ equals( element.tabs( "option", "active" ), 0 );
+ tabs_state( element, 1, 0, 0 );
+ });
+}
+
+test( "active - mismatched tab/panel order", function() {
+ expect( 3 );
+
+ location.hash = "#tabs7-2";
+ var element = $( "#tabs7" ).tabs();
+ equals( element.tabs( "option", "active" ), 1, "should be 1 based on URL" );
+ tabs_state( element, 0, 1 );
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0 );
+ location.hash = "#";
+});
+
+test( "{ collapsible: false }", function() {
+ expect( 4 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: 1
+ });
+ element.tabs( "option", "active", false );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.find( ".ui-state-active a" ).eq( 1 ).click();
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+});
+
+test( "{ collapsible: true }", function() {
+ expect( 6 );
+
+ var element = $( "#tabs1" ).tabs({
+ active: 1,
+ collapsible: true
+ });
+
+ element.tabs( "option", "active", false );
+ equal( element.tabs( "option", "active" ), false );
+ tabs_state( element, 0, 0, 0 );
+
+ element.tabs( "option", "active", 1 );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.find( ".ui-state-active a" ).click();
+ equal( element.tabs( "option", "active" ), false );
+ tabs_state( element, 0, 0, 0 );
+});
+
+test( "disabled", function() {
+ expect( 10 );
+
+ // fully enabled by default
+ var element = $( "#tabs1" ).tabs();
+ tabs_disabled( element, false );
+
+ // disable single tab
+ element.tabs( "option", "disabled", [ 1 ] );
+ tabs_disabled( element, [ 1 ] );
+
+ // disabled active tab
+ element.tabs( "option", "disabled", [ 0, 1 ] );
+ tabs_disabled( element, [ 0, 1 ] );
+
+ // disable all tabs
+ element.tabs( "option", "disabled", [ 0, 1, 2 ] );
+ tabs_disabled( element, true );
+
+ // enable all tabs
+ element.tabs( "option", "disabled", [] );
+ tabs_disabled( element, false );
+});
+
+test( "{ event: null }", function() {
+ expect( 5 );
+
+ var element = $( "#tabs1" ).tabs({
+ event: null
+ });
+ tabs_state( element, 1, 0, 0 );
+
+ element.tabs( "option", "active", 1 );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ element.find( ".ui-tabs-nav a" ).eq( 2 ).click();
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+});
+
+test( "{ event: custom }", function() {
+ expect( 11 );
+
+ var element = $( "#tabs1" ).tabs({
+ event: "custom1 custom2"
+ });
+ tabs_state( element, 1, 0, 0 );
+
+ element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom1" );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ element.find( ".ui-tabs-nav a" ).eq( 2 ).trigger( "click" );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+
+ element.find( ".ui-tabs-nav a" ).eq( 2 ).trigger( "custom2" );
+ equal( element.tabs( "option", "active" ), 2 );
+ tabs_state( element, 0, 0, 1 );
+
+ element.tabs( "option", "event", "custom3" );
+
+ // ensure old event handlers are unbound
+ element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom1" );
+ equal( element.tabs( "option", "active" ), 2 );
+ tabs_state( element, 0, 0, 1 );
+
+ element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom3" );
+ equal( element.tabs( "option", "active" ), 1 );
+ tabs_state( element, 0, 1, 0 );
+});
+
+// TODO: add animation tests
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js
new file mode 100644
index 0000000..c8afcbe
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js
@@ -0,0 +1,105 @@
+(function() {
+
+function testWidgetDefaults( widget, defaults ) {
+ var pluginDefaults = $.ui[ widget ].prototype.options;
+
+ // ensure that all defaults have the correct value
+ test( "defined defaults", function() {
+ $.each( defaults, function( key, val ) {
+ if ( $.isFunction( val ) ) {
+ ok( $.isFunction( pluginDefaults[ key ] ), key );
+ return;
+ }
+ same( pluginDefaults[ key ], val, key );
+ });
+ });
+
+ // ensure that all defaults were tested
+ test( "tested defaults", function() {
+ $.each( pluginDefaults, function( key, val ) {
+ ok( key in defaults, key );
+ });
+ });
+}
+
+var privateMethods = [
+ "_createWidget",
+ "destroy",
+ "option",
+ "_trigger"
+];
+
+function testWidgetOverrides( widget ) {
+ if ( $.uiBackCompat === false ) {
+ test( "$.widget overrides", function() {
+ $.each( privateMethods, function( i, method ) {
+ strictEqual( $.ui[ widget ].prototype[ method ],
+ $.Widget.prototype[ method ], "should not override " + method );
+ });
+ });
+ }
+}
+
+function testBasicUsage( widget ) {
+ test( "basic usage", function() {
+ var defaultElement = $.ui[ widget ].prototype.defaultElement;
+ $( defaultElement ).appendTo( "body" )[ widget ]().remove();
+ ok( true, "initialized on element" );
+
+ $( defaultElement )[ widget ]().remove();
+ ok( true, "initialized on disconnected DOMElement - never connected" );
+
+ $( defaultElement ).appendTo( "body" ).remove()[ widget ]().remove();
+ ok( true, "initialized on disconnected DOMElement - removed" );
+ });
+}
+
+window.commonWidgetTests = function( widget, settings ) {
+ module( widget + ": common widget" );
+
+ testWidgetDefaults( widget, settings.defaults );
+ testWidgetOverrides( widget );
+ testBasicUsage( widget );
+ test( "version", function() {
+ ok( "version" in $.ui[ widget ].prototype, "version property exists" );
+ });
+}
+
+/*
+ * Experimental assertion for comparing DOM objects.
+ *
+ * Serializes an element and some attributes and it's children if any, otherwise the text.
+ * Then compares the result using deepEqual.
+ */
+window.domEqual = function( selector, modifier, message ) {
+ var attributes = ["class", "role", "id", "tabIndex", "aria-activedescendant"];
+
+ function extract(value) {
+ if (!value || !value.length) {
+ QUnit.push( false, actual, expected, "domEqual failed, can't extract " + selector + ", message was: " + message );
+ return;
+ }
+ var result = {};
+ result.nodeName = value[0].nodeName;
+ $.each(attributes, function(index, attr) {
+ result[attr] = value.prop(attr);
+ });
+ result.children = [];
+ var children = value.children();
+ if (children.length) {
+ children.each(function() {
+ result.children.push(extract($(this)));
+ });
+ } else {
+ result.text = value.text();
+ }
+ return result;
+ }
+ var expected = extract($(selector));
+ modifier($(selector));
+
+ var actual = extract($(selector));
+ QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
+}
+
+}());
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html
new file mode 100644
index 0000000..0ef6e09
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Tooltip Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "tooltip" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Tooltip Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html
new file mode 100644
index 0000000..b5e8558
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Tooltip Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core", "ui.tooltip" ],
+ js: [
+ "ui/jquery.ui.core.js",
+ "ui/jquery.ui.widget.js",
+ "ui/jquery.ui.position.js",
+ "ui/jquery.ui.tooltip.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="tooltip_defaults.js"></script>
+ <script src="tooltip_core.js"></script>
+ <script src="tooltip_events.js"></script>
+ <script src="tooltip_methods.js"></script>
+ <script src="tooltip_options.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Tooltip Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div>
+ <a id="tooltipped1" href="#" title="anchortitle">anchor</a>
+ <input title="inputtitle">
+ <span id="fixture-span" title="title-text">span</span>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js
new file mode 100644
index 0000000..d18b853
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js
@@ -0,0 +1,26 @@
+(function( $ ) {
+
+module( "tooltip: core" );
+
+test( "markup structure", function() {
+ expect( 6 );
+ var element = $( "#tooltipped1" ).tooltip(),
+ tooltip = $( ".ui-tooltip" );
+
+ equal( element.attr( "aria-describedby" ), undefined, "no aria-describedby on init" );
+ equal( tooltip.length, 0, "no tooltip on init" );
+
+ element.tooltip( "open" );
+ tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ equal( tooltip.length, 1, "tooltip exists" );
+ ok( tooltip.hasClass( "ui-tooltip" ), "tooltip is .ui-tooltip" );
+ equal( tooltip.length, 1, ".ui-tooltip exists" );
+ equal( tooltip.find( ".ui-tooltip-content" ).length, 1,
+ ".ui-tooltip-content exists" );
+});
+
+test( "accessibility", function() {
+ // TODO: add tests
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js
new file mode 100644
index 0000000..b8b41bf
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js
@@ -0,0 +1,20 @@
+commonWidgetTests( "tooltip", {
+ defaults: {
+ content: function() {},
+ disabled: false,
+ hide: true,
+ items: "[title]",
+ position: {
+ my: "left+15 center",
+ at: "right center",
+ collision: "flipfit flipfit"
+ },
+ show: true,
+ tooltipClass: null,
+
+ // callbacks
+ close: null,
+ create: null,
+ open: null
+ }
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js
new file mode 100644
index 0000000..99e1fbd
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js
@@ -0,0 +1,83 @@
+(function( $ ) {
+
+module( "tooltip: events" );
+
+test( "programmatic triggers", function() {
+ expect( 4 );
+ var tooltip,
+ element = $( "#tooltipped1" ).tooltip();
+
+ element.one( "tooltipopen", function( event, ui ) {
+ tooltip = ui.tooltip;
+ ok( !( "originalEvent" in event ), "open" );
+ strictEqual( ui.tooltip[0],
+ $( "#" + element.attr( "aria-describedby" ) )[0], "ui.tooltip" );
+ });
+ element.tooltip( "open" );
+
+ element.one( "tooltipclose", function( event, ui ) {
+ ok( !( "originalEvent" in event ), "close" );
+ strictEqual( ui.tooltip[0], tooltip[0], "ui.tooltip" );
+ });
+ element.tooltip( "close" );
+});
+
+test( "mouse events", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip();
+
+ element.one( "tooltipopen", function( event ) {
+ same( event.originalEvent.type, "mouseover" );
+ });
+ element.trigger( "mouseover" );
+
+ element.one( "tooltipclose", function( event ) {
+ same( event.originalEvent.type, "mouseleave" );
+ });
+ element.trigger( "mouseleave" );
+});
+
+test( "focus events", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip();
+
+ element.one( "tooltipopen", function( event ) {
+ same( event.originalEvent.type, "focusin" );
+ });
+ element.trigger( "focusin" );
+
+ element.one( "tooltipclose", function( event ) {
+ same( event.originalEvent.type, "blur" );
+ });
+ element.trigger( "blur" );
+});
+
+asyncTest( "mixed events", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip();
+
+ element.one( "tooltipopen", function( event ) {
+ same( event.originalEvent.type, "focusin" );
+ });
+ element.simulate( "focus" );
+
+ element.one( "tooltipopen", function() {
+ ok( false, "open triggered while already open" );
+ });
+ element.trigger( "mouseover" );
+
+ element.bind( "tooltipclose", function( event ) {
+ ok( false, "close triggered while still focused" );
+ });
+ element.trigger( "mouseleave" );
+ element.unbind( "tooltipclose" );
+
+ // blurring is async in IE
+ element.one( "tooltipclose", function( event ) {
+ same( event.originalEvent.type, "blur" );
+ start();
+ });
+ element.simulate( "blur" );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js
new file mode 100644
index 0000000..74fd35d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js
@@ -0,0 +1,67 @@
+(function( $ ) {
+
+module( "tooltip: methods" );
+
+test( "destroy", function() {
+ expect( 2 );
+ domEqual( "#tooltipped1", function() {
+ $( "#tooltipped1" ).tooltip().tooltip( "destroy" );
+ });
+
+ // make sure that open tooltips are removed on destroy
+ $( "#tooltipped1" ).tooltip().tooltip( "open" ).tooltip( "destroy" );
+ equal( $( ".ui-tooltip" ).length, 0 );
+});
+
+test( "open/close", function() {
+ expect( 3 );
+ $.fx.off = true;
+ var element = $( "#tooltipped1" ).tooltip();
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" );
+
+ element.tooltip( "open" );
+ var tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ ok( tooltip.is( ":visible" ) );
+
+ element.tooltip( "close" );
+ ok( tooltip.is( ":hidden" ) );
+ $.fx.off = false;
+});
+
+test( "enable/disable", function() {
+ expect( 7 );
+ $.fx.off = true;
+ var element = $( "#tooltipped1" ).tooltip();
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" );
+
+ element.tooltip( "open" );
+ var tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ ok( tooltip.is( ":visible" ) );
+
+ element.tooltip( "disable" );
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
+ equal( tooltip.attr( "title" ), undefined, "title removed on disable" );
+
+ element.tooltip( "open" );
+ equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );
+
+ element.tooltip( "enable" );
+ equal( element.attr( "title" ), "anchortitle", "title restored on enable" );
+
+ element.tooltip( "open" );
+ tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ ok( tooltip.is( ":visible" ) );
+ $.fx.off = false;
+});
+
+/*
+TODO currently tooltip doesn't override widget
+can't return anything useful if no element is kept around and there's no useful reference
+test("widget", function() {
+ var tooltip = $("#tooltipped1").tooltip();
+ same(tooltip.tooltip("widget")[0], $(".ui-tooltip")[0]);
+ same(tooltip.tooltip("widget").end()[0], tooltip[0]);
+});
+*/
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js
new file mode 100644
index 0000000..04bb4c6
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js
@@ -0,0 +1,73 @@
+(function( $ ) {
+
+module( "tooltip: options" );
+
+test( "content: default", function() {
+ var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
+ same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" );
+});
+
+test( "content: return string", function() {
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function() {
+ return "customstring";
+ }
+ }).tooltip( "open" );
+ same( $( "#" + element.attr( "aria-describedby" ) ).text(), "customstring" );
+});
+
+test( "content: return jQuery", function() {
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function() {
+ return $( "<div>" ).html( "cu<b>s</b>tomstring" );
+ }
+ }).tooltip( "open" );
+ same( $( "#" + element.attr( "aria-describedby" ) ).text(), "customstring" );
+});
+
+asyncTest( "content: sync + async callback", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function( response ) {
+ setTimeout(function() {
+ same( $( "#" + element.attr("aria-describedby") ).text(), "loading..." );
+
+ response( "customstring2" );
+ setTimeout(function() {
+ same( $( "#" + element.attr("aria-describedby") ).text(), "customstring2" );
+ start();
+ }, 13 );
+ }, 13 );
+ return "loading...";
+ }
+ }).tooltip( "open" );
+});
+
+test( "items", function() {
+ expect( 2 );
+ var element = $( "#qunit-fixture" ).tooltip({
+ items: "#fixture-span"
+ });
+
+ var event = $.Event( "mouseenter" );
+ event.target = $( "#fixture-span" )[ 0 ];
+ element.tooltip( "open", event );
+ same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" );
+
+ // make sure default [title] doesn't get used
+ event.target = $( "#tooltipped1" )[ 0 ];
+ element.tooltip( "open", event );
+ same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined );
+
+ element.tooltip( "destroy" );
+});
+
+test( "tooltipClass", function() {
+ expect( 1 )
+ var element = $( "#tooltipped1" ).tooltip({
+ tooltipClass: "custom"
+ }).tooltip( "open" );
+ ok( $( "#" + element.attr( "aria-describedby" ) ).hasClass( "custom" ) );
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html
new file mode 100644
index 0000000..ae8bc3c
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Widget Test Suite</title>
+
+ <script src="../../../jquery-1.7.1.js"></script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <link rel="stylesheet" href="../subsuiteRunner.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../subsuiteRunner.js"></script>
+ <script src="../subsuite.js"></script>
+
+ <script>
+ testAllVersions( "widget" );
+ </script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Widget Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html
new file mode 100644
index 0000000..6f4caaa
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Widget Test Suite</title>
+
+ <script src="../../jquery.js"></script>
+ <script src="../../resource_loader.js"></script>
+ <script>
+ loadResources({
+ css: [ "ui.core" ],
+ js: [
+ "ui/jquery.ui.widget.js"
+ ]
+ });
+ </script>
+
+ <link rel="stylesheet" href="../../../external/qunit.css">
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.simulate.js"></script>
+ <script src="../testsuite.js"></script>
+
+ <script src="widget_core.js"></script>
+ <script src="widget_extend.js"></script>
+ <script src="widget_animation.js"></script>
+
+ <script src="../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery UI Widget Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+<div id="qunit-fixture">
+
+<div id="widget-wrapper">
+ <div id="widget">
+ <div>...</div>
+ </div>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js
new file mode 100644
index 0000000..8ef55aa
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js
@@ -0,0 +1,257 @@
+
+module( "widget animation", (function() {
+ var show = $.fn.show,
+ fadeIn = $.fn.fadeIn,
+ slideDown = $.fn.slideDown;
+ return {
+ setup: function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ this.element.hide();
+ },
+ show: function( fn ) {
+ this._show( this.element, this.options.show, fn );
+ }
+ });
+ $.effects = { effect: { testEffect: $.noop } };
+ },
+ teardown: function() {
+ delete $.ui.testWidget;
+ delete $.effects.effect.testEffect;
+ $.fn.show = show;
+ $.fn.fadeIn = fadeIn;
+ $.fn.slideDown = slideDown;
+ }
+ };
+}()));
+
+asyncTest( "show: null", function() {
+ expect( 4 );
+
+ var element = $( "#widget" ).testWidget(),
+ hasRun = false;
+ $.fn.show = function() {
+ ok( true, "show called" );
+ equal( arguments.length, 0, "no args passed to show" );
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: true", function() {
+ expect( 4 );
+
+ var element = $( "#widget" ).testWidget({
+ show: true
+ }),
+ hasRun = false;
+ $.fn.fadeIn = function( duration, easing, complete ) {
+ return this.queue(function( next ) {
+ strictEqual( duration, undefined, "duration" );
+ strictEqual( easing, undefined, "easing" );
+ complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: number", function() {
+ expect( 4 );
+
+ var element = $( "#widget" ).testWidget({
+ show: 123
+ }),
+ hasRun = false;
+ $.fn.fadeIn = function( duration, easing, complete ) {
+ return this.queue(function( next ) {
+ strictEqual( duration, 123, "duration" );
+ strictEqual( easing, undefined, "easing" );
+ complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: core animation", function() {
+ expect( 4 );
+
+ var element = $( "#widget" ).testWidget({
+ show: "slideDown"
+ }),
+ hasRun = false;
+ $.fn.slideDown = function( duration, easing, complete ) {
+ return this.queue(function( next ) {
+ strictEqual( duration, undefined, "duration" );
+ strictEqual( easing, undefined, "easing" );
+ complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: effect", function() {
+ expect( 5 );
+
+ var element = $( "#widget" ).testWidget({
+ show: "testEffect"
+ }),
+ hasRun = false;
+ $.fn.show = function( options ) {
+ return this.queue(function( next ) {
+ equal( options.effect, "testEffect", "effect" );
+ ok( !("duration" in options), "duration" );
+ ok( !("easing" in options), "easing" );
+ options.complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: object(core animation)", function() {
+ expect( 4 );
+
+ var element = $( "#widget" ).testWidget({
+ show: {
+ effect: "slideDown",
+ duration: 123,
+ easing: "testEasing"
+ }
+ }),
+ hasRun = false;
+ $.fn.slideDown = function( duration, easing, complete ) {
+ return this.queue(function( next ) {
+ equal( duration, 123, "duration" );
+ equal( easing, "testEasing", "easing" );
+ complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
+
+asyncTest( "show: object(effect)", function() {
+ expect( 3 );
+
+ var element = $( "#widget" ).testWidget({
+ show: {
+ effect: "testEffect",
+ duration: 123,
+ easing: "testEasing"
+ }
+ }),
+ hasRun = false;
+ $.fn.show = function( options ) {
+ return this.queue(function( next ) {
+ deepEqual( options, {
+ effect: "testEffect",
+ duration: 123,
+ easing: "testEasing",
+ complete: options.complete
+ });
+ options.complete();
+ next();
+ });
+ };
+
+ element
+ .delay( 50 )
+ .queue(function( next ) {
+ ok( !hasRun, "queue before show" );
+ next();
+ })
+ .testWidget( "show", function() {
+ hasRun = true;
+ })
+ .queue(function( next ) {
+ ok( hasRun, "queue after show" );
+ start();
+ next();
+ });
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js
new file mode 100644
index 0000000..2e55ad7
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js
@@ -0,0 +1,1069 @@
+(function( $ ) {
+
+module( "widget factory", {
+ teardown: function() {
+ delete $.ui.testWidget;
+ }
+});
+
+test( "widget creation", function() {
+ var myPrototype = {
+ _create: function() {},
+ creationTest: function() {}
+ };
+
+ $.widget( "ui.testWidget", myPrototype );
+ ok( $.isFunction( $.ui.testWidget ), "constructor was created" );
+ equals( "object", typeof $.ui.testWidget.prototype, "prototype was created" );
+ equals( $.ui.testWidget.prototype._create, myPrototype._create,
+ "create function is copied over" );
+ equals( $.ui.testWidget.prototype.creationTest, myPrototype.creationTest,
+ "random function is copied over" );
+ equals( $.ui.testWidget.prototype.option, $.Widget.prototype.option,
+ "option method copied over from base widget" );
+});
+
+test( "element normalization", function() {
+ expect( 11 );
+ var elem;
+ $.widget( "ui.testWidget", {} );
+
+ $.ui.testWidget.prototype._create = function() {
+ // workaround for core ticket #8381
+ this.element.appendTo( "#qunit-fixture" );
+ ok( this.element.is( "div" ), "generated div" );
+ same( this.element.data( "testWidget" ), this, "intance stored in .data()" );
+ };
+ $.ui.testWidget();
+
+ $.ui.testWidget.prototype.defaultElement = "<span data-test='pass'></span>";
+ $.ui.testWidget.prototype._create = function() {
+ ok( this.element.is( "span[data-test=pass]" ), "generated span with properties" );
+ same( this.element.data( "testWidget" ), this, "instace stored in .data()" );
+ };
+ $.ui.testWidget();
+
+ elem = $( "<input>" );
+ $.ui.testWidget.prototype._create = function() {
+ same( this.element[ 0 ], elem[ 0 ], "from element" );
+ same( elem.data( "testWidget" ), this, "instace stored in .data()" );
+ };
+ $.ui.testWidget( {}, elem[ 0 ] );
+
+ elem = $( "<div>" );
+ $.ui.testWidget.prototype._create = function() {
+ same( this.element[ 0 ], elem[ 0 ], "from jQuery object" );
+ same( elem.data( "testWidget" ), this, "instace stored in .data()" );
+ };
+ $.ui.testWidget( {}, elem );
+
+ elem = $( "<div id='element-normalization-selector'></div>" )
+ .appendTo( "#qunit-fixture" );
+ $.ui.testWidget.prototype._create = function() {
+ same( this.element[ 0 ], elem[ 0 ], "from selector" );
+ same( elem.data( "testWidget" ), this, "instace stored in .data()" );
+ };
+ $.ui.testWidget( {}, "#element-normalization-selector" );
+
+ $.ui.testWidget.prototype.defaultElement = null;
+ $.ui.testWidget.prototype._create = function() {
+ // using strictEqual throws an error (Maximum call stack size exceeded)
+ ok( this.element[ 0 ] === this, "instance as element" );
+ };
+ $.ui.testWidget();
+});
+
+test( "jQuery usage", function() {
+ expect( 13 );
+
+ var shouldCreate = false;
+
+ $.widget( "ui.testWidget", {
+ getterSetterVal: 5,
+ _create: function() {
+ ok( shouldCreate, "create called on instantiation" );
+ },
+ methodWithParams: function( param1, param2 ) {
+ ok( true, "method called via .pluginName(methodName)" );
+ equals( param1, "value1",
+ "parameter passed via .pluginName(methodName, param)" );
+ equals( param2, "value2",
+ "multiple parameters passed via .pluginName(methodName, param, param)" );
+
+ return this;
+ },
+ getterSetterMethod: function( val ) {
+ if ( val ) {
+ this.getterSetterVal = val;
+ } else {
+ return this.getterSetterVal;
+ }
+ },
+ jQueryObject: function() {
+ return $( "body" );
+ }
+ });
+
+ shouldCreate = true;
+ var elem = $( "<div>" )
+ .bind( "testwidgetcreate", function() {
+ ok( shouldCreate, "create event triggered on instantiation" );
+ })
+ .testWidget();
+ shouldCreate = false;
+
+ var instance = elem.data( "testWidget" );
+ equals( typeof instance, "object", "instance stored in .data(pluginName)" );
+ equals( instance.element[0], elem[0], "element stored on widget" );
+ var ret = elem.testWidget( "methodWithParams", "value1", "value2" );
+ equals( ret, elem, "jQuery object returned from method call" );
+
+ ret = elem.testWidget( "getterSetterMethod" );
+ equals( ret, 5, "getter/setter can act as getter" );
+ ret = elem.testWidget( "getterSetterMethod", 30 );
+ equals( ret, elem, "getter/setter method can be chainable" );
+ equals( instance.getterSetterVal, 30, "getter/setter can act as setter" );
+ ret = elem.testWidget( "jQueryObject" );
+ equal( ret[ 0 ], document.body, "returned jQuery object" );
+ equal( ret.end(), elem, "stack preserved" );
+});
+
+test( "direct usage", function() {
+ expect( 9 );
+
+ var shouldCreate = false;
+
+ $.widget( "ui.testWidget", {
+ getterSetterVal: 5,
+ _create: function() {
+ ok( shouldCreate, "create called on instantiation" );
+ },
+ methodWithParams: function( param1, param2 ) {
+ ok( true, "method called dirctly" );
+ equals( param1, "value1", "parameter passed via direct call" );
+ equals( param2, "value2", "multiple parameters passed via direct call" );
+
+ return this;
+ },
+ getterSetterMethod: function( val ) {
+ if ( val ) {
+ this.getterSetterVal = val;
+ } else {
+ return this.getterSetterVal;
+ }
+ }
+ });
+
+ var elem = $( "<div>" )[ 0 ];
+
+ shouldCreate = true;
+ var instance = new $.ui.testWidget( {}, elem );
+ shouldCreate = false;
+
+ equals( $( elem ).data( "testWidget" ), instance,
+ "instance stored in .data(pluginName)" );
+ equals( instance.element[ 0 ], elem, "element stored on widget" );
+
+ var ret = instance.methodWithParams( "value1", "value2" );
+ equals( ret, instance, "plugin returned from method call" );
+
+ ret = instance.getterSetterMethod();
+ equals( ret, 5, "getter/setter can act as getter" );
+ instance.getterSetterMethod( 30 );
+ equals( instance.getterSetterVal, 30, "getter/setter can act as setter" );
+});
+
+test( "error handling", function() {
+ expect( 3 );
+ var error = $.error;
+ $.widget( "ui.testWidget", {
+ _privateMethod: function () {}
+ });
+ $.error = function( msg ) {
+ equal( msg, "cannot call methods on testWidget prior to initialization; " +
+ "attempted to call method 'missing'", "method call before init" );
+ };
+ $( "<div>" ).testWidget( "missing" );
+ $.error = function( msg ) {
+ equal( msg, "no such method 'missing' for testWidget widget instance",
+ "invalid method call on widget instance" );
+ };
+ $( "<div>" ).testWidget().testWidget( "missing" );
+ $.error = function ( msg ) {
+ equal( msg, "no such method '_privateMethod' for testWidget widget instance",
+ "invalid method call on widget instance" );
+ };
+ $( "<div>" ).testWidget().testWidget( "_privateMethod" );
+ $.error = error;
+});
+
+test( "merge multiple option arguments", function() {
+ expect( 1 );
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ same( this.options, {
+ create: null,
+ disabled: false,
+ option1: "value1",
+ option2: "value2",
+ option3: "value3",
+ option4: {
+ option4a: "valuea",
+ option4b: "valueb"
+ }
+ });
+ }
+ });
+ $( "<div>" ).testWidget({
+ option1: "valuex",
+ option2: "valuex",
+ option3: "value3",
+ option4: {
+ option4a: "valuex"
+ }
+ }, {
+ option1: "value1",
+ option2: "value2",
+ option4: {
+ option4b: "valueb"
+ }
+ }, {
+ option4: {
+ option4a: "valuea"
+ }
+ });
+});
+
+test( "._getCreateOptions()", function() {
+ expect( 1 );
+ $.widget( "ui.testWidget", {
+ options: {
+ option1: "valuex",
+ option2: "valuex",
+ option3: "value3"
+ },
+ _getCreateOptions: function() {
+ return {
+ option1: "override1",
+ option2: "overideX"
+ };
+ },
+ _create: function() {
+ same( this.options, {
+ create: null,
+ disabled: false,
+ option1: "override1",
+ option2: "value2",
+ option3: "value3"
+ });
+ }
+ });
+ $( "<div>" ).testWidget({ option2: "value2" });
+});
+
+test( "re-init", function() {
+ var div = $( "<div>" ),
+ actions = [];
+
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ actions.push( "create" );
+ },
+ _init: function() {
+ actions.push( "init" );
+ },
+ _setOption: function( key, value ) {
+ actions.push( "option" + key );
+ }
+ });
+
+ actions = [];
+ div.testWidget({ foo: "bar" });
+ same( actions, [ "create", "init" ], "correct methods called on init" );
+
+ actions = [];
+ div.testWidget();
+ same( actions, [ "init" ], "correct methods call on re-init" );
+
+ actions = [];
+ div.testWidget({ foo: "bar" });
+ same( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" );
+});
+
+test( "inheritance - options", function() {
+ // #5830 - Widget: Using inheritance overwrites the base classes options
+ $.widget( "ui.testWidgetBase", {
+ options: {
+ obj: {
+ key1: "foo",
+ key2: "bar"
+ },
+ arr: [ "testing" ]
+ }
+ });
+
+ $.widget( "ui.testWidgetExtension", $.ui.testWidgetBase, {
+ options: {
+ obj: {
+ key1: "baz"
+ },
+ arr: [ "alpha", "beta" ]
+ }
+ });
+
+ same( $.ui.testWidgetBase.prototype.options.obj, {
+ key1: "foo",
+ key2: "bar"
+ }, "base class option object not overridden");
+ same( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ],
+ "base class option array not overridden");
+
+ same( $.ui.testWidgetExtension.prototype.options.obj, {
+ key1: "baz",
+ key2: "bar"
+ }, "extension class option object extends base");
+ same( $.ui.testWidgetExtension.prototype.options.arr, [ "alpha", "beta" ],
+ "extension class option array overwrites base");
+
+ delete $.ui.testWidgetBase;
+ delete $.ui.testWidgetExtension;
+});
+
+test( "._super()", function() {
+ expect( 9 );
+ var instance;
+ $.widget( "ui.testWidget", {
+ method: function( a, b ) {
+ same( this, instance, "this is correct in testWidget" );
+ same( a, 5, "parameter passed to testWidget" );
+ same( b, 20, "second parameter passed to testWidget" );
+ return a + b;
+ }
+ });
+
+ $.widget( "ui.testWidget2", $.ui.testWidget, {
+ method: function( a, b ) {
+ same( this, instance, "this is correct in testWidget2" );
+ same( a, 5, "parameter passed to testWidget2" );
+ same( b, 10, "parameter passed to testWidget2" );
+ return this._super( a, b*2 );
+ }
+ });
+
+ $.widget( "ui.testWidget3", $.ui.testWidget2, {
+ method: function( a ) {
+ same( this, instance, "this is correct in testWidget3" );
+ same( a, 5, "parameter passed to testWidget3" );
+ var ret = this._super( a, a*2 );
+ same( ret, 25, "super returned value" );
+ }
+ });
+
+ instance = $( "<div>" ).testWidget3().data( "testWidget3" );
+ instance.method( 5 );
+ delete $.ui.testWidget3;
+ delete $.ui.testWidget2;
+});
+
+test( "._superApply()", function() {
+ expect( 10 );
+ var instance;
+ $.widget( "ui.testWidget", {
+ method: function( a, b ) {
+ same( this, instance, "this is correct in testWidget" );
+ same( a, 5, "parameter passed to testWidget" );
+ same( b, 10, "second parameter passed to testWidget" );
+ return a + b;
+ }
+ });
+
+ $.widget( "ui.testWidget2", $.ui.testWidget, {
+ method: function( a, b ) {
+ same( this, instance, "this is correct in testWidget2" );
+ same( a, 5, "parameter passed to testWidget2" );
+ same( b, 10, "second parameter passed to testWidget2" );
+ return this._superApply( arguments );
+ }
+ });
+
+ $.widget( "ui.testWidget3", $.ui.testWidget2, {
+ method: function( a, b ) {
+ same( this, instance, "this is correct in testWidget3" );
+ same( a, 5, "parameter passed to testWidget3" );
+ same( b, 10, "second parameter passed to testWidget3" );
+ var ret = this._superApply( arguments );
+ same( ret, 15, "super returned value" );
+ }
+ });
+
+ instance = $( "<div>" ).testWidget3().data( "testWidget3" );
+ instance.method( 5, 10 );
+ delete $.ui.testWidget3;
+ delete $.ui.testWidget2;
+});
+
+test( ".option() - getter", function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {}
+ });
+
+ var div = $( "<div>" ).testWidget({
+ foo: "bar",
+ baz: 5,
+ qux: [ "quux", "quuux" ]
+ });
+
+ same( div.testWidget( "option", "x" ), null, "non-existent option" );
+ same( div.testWidget( "option", "foo"), "bar", "single option - string" );
+ same( div.testWidget( "option", "baz"), 5, "single option - number" );
+ same( div.testWidget( "option", "qux"), [ "quux", "quuux" ],
+ "single option - array" );
+
+ var options = div.testWidget( "option" );
+ same( options, {
+ create: null,
+ disabled: false,
+ foo: "bar",
+ baz: 5,
+ qux: [ "quux", "quuux" ]
+ }, "full options hash returned" );
+ options.foo = "notbar";
+ same( div.testWidget( "option", "foo"), "bar",
+ "modifying returned options hash does not modify plugin instance" );
+});
+
+test( ".option() - deep option getter", function() {
+ $.widget( "ui.testWidget", {} );
+ var div = $( "<div>" ).testWidget({
+ foo: {
+ bar: "baz",
+ qux: {
+ quux: "xyzzy"
+ }
+ }
+ });
+ equal( div.testWidget( "option", "foo.bar" ), "baz", "one level deep - string" );
+ deepEqual( div.testWidget( "option", "foo.qux" ), { quux: "xyzzy" },
+ "one level deep - object" );
+ equal( div.testWidget( "option", "foo.qux.quux" ), "xyzzy", "two levels deep - string" );
+ equal( div.testWidget( "option", "x.y" ), null, "top level non-existent" );
+ equal( div.testWidget( "option", "foo.x.y" ), null, "one level deep - non-existent" );
+});
+
+test( ".option() - delegate to ._setOptions()", function() {
+ var calls = [];
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ _setOptions: function( options ) {
+ calls.push( options );
+ }
+ });
+ var div = $( "<div>" ).testWidget();
+
+ calls = [];
+ div.testWidget( "option", "foo", "bar" );
+ same( calls, [{ foo: "bar" }], "_setOptions called for single option" );
+
+ calls = [];
+ div.testWidget( "option", {
+ bar: "qux",
+ quux: "quuux"
+ });
+ same( calls, [{ bar: "qux", quux: "quuux" }],
+ "_setOptions called with multiple options" );
+});
+
+test( ".option() - delegate to ._setOption()", function() {
+ var calls = [];
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ _setOption: function( key, val ) {
+ calls.push({
+ key: key,
+ val: val
+ });
+ }
+ });
+ var div = $( "<div>" ).testWidget();
+
+ calls = [];
+ div.testWidget( "option", "foo", "bar" );
+ same( calls, [{ key: "foo", val: "bar" }],
+ "_setOption called for single option" );
+
+ calls = [];
+ div.testWidget( "option", {
+ bar: "qux",
+ quux: "quuux"
+ });
+ same( calls, [
+ { key: "bar", val: "qux" },
+ { key: "quux", val: "quuux" }
+ ], "_setOption called with multiple options" );
+});
+
+test( ".option() - deep option setter", function() {
+ $.widget( "ui.testWidget", {} );
+ var div = $( "<div>" ).testWidget();
+ function deepOption( from, to, msg ) {
+ div.data( "testWidget" ).options.foo = from;
+ $.ui.testWidget.prototype._setOption = function( key, value ) {
+ same( key, "foo", msg + ": key" );
+ same( value, to, msg + ": value" );
+ };
+ }
+
+ deepOption( { bar: "baz" }, { bar: "qux" }, "one deep" );
+ div.testWidget( "option", "foo.bar", "qux" );
+
+ deepOption( null, { bar: "baz" }, "null" );
+ div.testWidget( "option", "foo.bar", "baz" );
+
+ deepOption(
+ { bar: "baz", qux: { quux: "quuux" } },
+ { bar: "baz", qux: { quux: "quuux", newOpt: "newVal" } },
+ "add property" );
+ div.testWidget( "option", "foo.qux.newOpt", "newVal" );
+});
+
+test( ".enable()", function() {
+ expect( 2 );
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ _setOption: function( key, val ) {
+ same( key, "disabled", "_setOption called with disabled option" );
+ same( val, false, "disabled set to false" );
+ }
+ });
+ $( "<div>" ).testWidget().testWidget( "enable" );
+});
+
+test( ".disable()", function() {
+ expect( 2 );
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ _setOption: function( key, val ) {
+ same( key, "disabled", "_setOption called with disabled option" );
+ same( val, true, "disabled set to true" );
+ }
+ });
+ $( "<div>" ).testWidget().testWidget( "disable" );
+});
+
+test( ".widget() - base", function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {}
+ });
+ var div = $( "<div>" ).testWidget();
+ same( div[0], div.testWidget( "widget" )[0]);
+});
+
+test( ".widget() - overriden", function() {
+ var wrapper = $( "<div>" );
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ widget: function() {
+ return wrapper;
+ }
+ });
+ same( wrapper[0], $( "<div>" ).testWidget().testWidget( "widget" )[0] );
+});
+
+test( "._bind() to element (default)", function() {
+ expect( 12 );
+ var that;
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ that = this;
+ this._bind({
+ keyup: this.keyup,
+ keydown: "keydown"
+ });
+ },
+ keyup: function( event ) {
+ equals( that, this );
+ equals( that.element[0], event.currentTarget );
+ equals( "keyup", event.type );
+ },
+ keydown: function( event ) {
+ equals( that, this );
+ equals( that.element[0], event.currentTarget );
+ equals( "keydown", event.type );
+ }
+ });
+ var widget = $( "<div></div>" )
+ .testWidget()
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "disable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "enable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "destroy" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+});
+
+test( "._bind() to descendent", function() {
+ expect( 12 );
+ var that;
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ that = this;
+ this._bind( this.element.find( "strong" ), {
+ keyup: this.keyup,
+ keydown: "keydown"
+ });
+ },
+ keyup: function( event ) {
+ equals( that, this );
+ equals( that.element.find( "strong" )[0], event.currentTarget );
+ equals( "keyup", event.type );
+ },
+ keydown: function(event) {
+ equals( that, this );
+ equals( that.element.find( "strong" )[0], event.currentTarget );
+ equals( "keydown", event.type );
+ }
+ });
+ // trigger events on both widget and descendent to ensure that only descendent receives them
+ var widget = $( "<div><p><strong>hello</strong> world</p></div>" )
+ .testWidget()
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ var descendent = widget.find( "strong" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "disable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ descendent
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "enable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ descendent
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ descendent
+ .addClass( "ui-state-disabled" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "destroy" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ descendent
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+});
+
+test( "_bind() with delegate", function() {
+ expect( 8 );
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ this.element = {
+ bind: function( event, handler ) {
+ equal( event, "click.testWidget" );
+ ok( $.isFunction(handler) );
+ },
+ trigger: $.noop
+ };
+ this.widget = function() {
+ return {
+ delegate: function( selector, event, handler ) {
+ equal( selector, "a" );
+ equal( event, "click.testWidget" );
+ ok( $.isFunction(handler) );
+ }
+ };
+ };
+ this._bind({
+ "click": "handler",
+ "click a": "handler"
+ });
+ this.widget = function() {
+ return {
+ delegate: function( selector, event, handler ) {
+ equal( selector, "form fieldset > input" );
+ equal( event, "change.testWidget" );
+ ok( $.isFunction(handler) );
+ }
+ };
+ };
+ this._bind({
+ "change form fieldset > input": "handler"
+ });
+ }
+ });
+ $.ui.testWidget();
+});
+
+test( "._hoverable()", function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ this._hoverable( this.element.children() );
+ }
+ });
+
+ var div = $( "#widget" ).testWidget().children();
+ ok( !div.hasClass( "ui-state-hover" ), "not hovered on init" );
+ div.trigger( "mouseenter" );
+ ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" );
+ div.trigger( "mouseleave" );
+ ok( !div.hasClass( "ui-state-hover" ), "not hovered after mouseleave" );
+
+ div.trigger( "mouseenter" );
+ ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" );
+ $( "#widget" ).testWidget( "disable" );
+ ok( !div.hasClass( "ui-state-hover" ), "not hovered while disabled" );
+ div.trigger( "mouseenter" );
+ ok( !div.hasClass( "ui-state-hover" ), "can't hover while disabled" );
+ $( "#widget" ).testWidget( "enable" );
+ ok( !div.hasClass( "ui-state-hover" ), "enabling doesn't reset hover" );
+
+ div.trigger( "mouseenter" );
+ ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" );
+ $( "#widget" ).testWidget( "destroy" );
+ ok( !div.hasClass( "ui-state-hover" ), "not hovered after destroy" );
+ div.trigger( "mouseenter" );
+ ok( !div.hasClass( "ui-state-hover" ), "event handler removed on destroy" );
+});
+
+test( "._focusable()", function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ this._focusable( this.element.children() );
+ }
+ });
+
+ var div = $( "#widget" ).testWidget().children();
+ ok( !div.hasClass( "ui-state-focus" ), "not focused on init" );
+ div.trigger( "focusin" );
+ ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
+ div.trigger( "focusout" );
+ ok( !div.hasClass( "ui-state-focus" ), "not focused after blur" );
+
+ div.trigger( "focusin" );
+ ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
+ $( "#widget" ).testWidget( "disable" );
+ ok( !div.hasClass( "ui-state-focus" ), "not focused while disabled" );
+ div.trigger( "focusin" );
+ ok( !div.hasClass( "ui-state-focus" ), "can't focus while disabled" );
+ $( "#widget" ).testWidget( "enable" );
+ ok( !div.hasClass( "ui-state-focus" ), "enabling doesn't reset focus" );
+
+ div.trigger( "focusin" );
+ ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
+ $( "#widget" ).testWidget( "destroy" );
+ ok( !div.hasClass( "ui-state-focus" ), "not focused after destroy" );
+ div.trigger( "focusin" );
+ ok( !div.hasClass( "ui-state-focus" ), "event handler removed on destroy" );
+});
+
+test( "._trigger() - no event, no ui", function() {
+ expect( 7 );
+ var handlers = [];
+
+ $.widget( "ui.testWidget", {
+ _create: function() {}
+ });
+
+ $( "#widget" ).testWidget({
+ foo: function( event, ui ) {
+ same( event.type, "testwidgetfoo", "correct event type in callback" );
+ same( ui, {}, "empty ui hash passed" );
+ handlers.push( "callback" );
+ }
+ });
+ $( document ).add( "#widget-wrapper" ).add( "#widget" )
+ .bind( "testwidgetfoo", function( event, ui ) {
+ same( ui, {}, "empty ui hash passed" );
+ handlers.push( this );
+ });
+ same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), true,
+ "_trigger returns true when event is not cancelled" );
+ same( handlers, [
+ $( "#widget" )[ 0 ],
+ $( "#widget-wrapper" )[ 0 ],
+ document,
+ "callback"
+ ], "event bubbles and then invokes callback" );
+
+ $( document ).unbind( "testwidgetfoo" );
+});
+
+test( "._trigger() - cancelled event", function() {
+ expect( 3 );
+
+ $.widget( "ui.testWidget", {
+ _create: function() {}
+ });
+
+ $( "#widget" ).testWidget({
+ foo: function( event, ui ) {
+ ok( true, "callback invoked even if event is cancelled" );
+ }
+ })
+ .bind( "testwidgetfoo", function( event, ui ) {
+ ok( true, "event was triggered" );
+ return false;
+ });
+ same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), false,
+ "_trigger returns false when event is cancelled" );
+});
+
+test( "._trigger() - cancelled callback", function() {
+ $.widget( "ui.testWidget", {
+ _create: function() {}
+ });
+
+ $( "#widget" ).testWidget({
+ foo: function( event, ui ) {
+ return false;
+ }
+ });
+ same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), false,
+ "_trigger returns false when callback returns false" );
+});
+
+test( "._trigger() - provide event and ui", function() {
+ expect( 7 );
+
+ var originalEvent = $.Event( "originalTest" );
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ testEvent: function() {
+ var ui = {
+ foo: "bar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ };
+ this._trigger( "foo", originalEvent, ui );
+ same( ui, {
+ foo: "notbar",
+ baz: {
+ qux: 10,
+ quux: "jQuery"
+ }
+ }, "ui object modified" );
+ }
+ });
+ $( "#widget" ).bind( "testwidgetfoo", function( event, ui ) {
+ equal( event.originalEvent, originalEvent, "original event object passed" );
+ same( ui, {
+ foo: "bar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ }, "ui hash passed" );
+ ui.foo = "notbar";
+ });
+ $( "#widget-wrapper" ).bind( "testwidgetfoo", function( event, ui ) {
+ equal( event.originalEvent, originalEvent, "original event object passed" );
+ same( ui, {
+ foo: "notbar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ }, "modified ui hash passed" );
+ ui.baz.qux = 10;
+ });
+ $( "#widget" ).testWidget({
+ foo: function( event, ui ) {
+ equal( event.originalEvent, originalEvent, "original event object passed" );
+ same( ui, {
+ foo: "notbar",
+ baz: {
+ qux: 10,
+ quux: 20
+ }
+ }, "modified ui hash passed" );
+ ui.baz.quux = "jQuery";
+ }
+ })
+ .testWidget( "testEvent" );
+});
+
+test( "._trigger() - array as ui", function() {
+ // #6795 - Widget: handle array arguments to _trigger consistently
+ expect( 4 );
+
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ testEvent: function() {
+ var ui = {
+ foo: "bar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ };
+ var extra = {
+ bar: 5
+ };
+ this._trigger( "foo", null, [ ui, extra ] );
+ }
+ });
+ $( "#widget" ).bind( "testwidgetfoo", function( event, ui, extra ) {
+ same( ui, {
+ foo: "bar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ }, "event: ui hash passed" );
+ same( extra, {
+ bar: 5
+ }, "event: extra argument passed" );
+ });
+ $( "#widget" ).testWidget({
+ foo: function( event, ui, extra ) {
+ same( ui, {
+ foo: "bar",
+ baz: {
+ qux: 5,
+ quux: 20
+ }
+ }, "callback: ui hash passed" );
+ same( extra, {
+ bar: 5
+ }, "callback: extra argument passed" );
+ }
+ })
+ .testWidget( "testEvent" );
+});
+
+test( "._trigger() - instance as element", function() {
+ expect( 4 );
+ $.widget( "ui.testWidget", {
+ defaultElement: null,
+ testEvent: function() {
+ var ui = { foo: "bar" };
+ this._trigger( "foo", null, ui );
+ }
+ });
+ var instance = $.ui.testWidget({
+ foo: function( event, ui ) {
+ equal( event.type, "testwidgetfoo", "event object passed to callback" );
+ same( ui, { foo: "bar" }, "ui object passed to callback" );
+ }
+ });
+ $( instance ).bind( "testwidgetfoo", function( event, ui ) {
+ equal( event.type, "testwidgetfoo", "event object passed to event handler" );
+ same( ui, { foo: "bar" }, "ui object passed to event handler" );
+ });
+ instance.testEvent();
+});
+
+(function() {
+ function shouldDestroy( expected, callback ) {
+ expect( 1 );
+ var destroyed = false;
+ $.widget( "ui.testWidget", {
+ _create: function() {},
+ destroy: function() {
+ destroyed = true;
+ }
+ });
+ callback();
+ equal( destroyed, expected );
+ }
+
+ test( "auto-destroy - .remove()", function() {
+ shouldDestroy( true, function() {
+ $( "#widget" ).testWidget().remove();
+ });
+ });
+
+ test( "auto-destroy - .remove() on parent", function() {
+ shouldDestroy( true, function() {
+ $( "#widget" ).testWidget().parent().remove();
+ });
+ });
+
+ test( "auto-destroy - .remove() on child", function() {
+ shouldDestroy( false, function() {
+ $( "#widget" ).testWidget().children().remove();
+ });
+ });
+
+ test( "auto-destroy - .empty()", function() {
+ shouldDestroy( false, function() {
+ $( "#widget" ).testWidget().empty();
+ });
+ });
+
+ test( "auto-destroy - .empty() on parent", function() {
+ shouldDestroy( true, function() {
+ $( "#widget" ).testWidget().parent().empty();
+ });
+ });
+
+ test( "auto-destroy - .detach()", function() {
+ shouldDestroy( false, function() {
+ $( "#widget" ).testWidget().detach();
+ });
+ });
+}());
+
+test( "redefine", function() {
+ expect( 4 );
+ $.widget( "ui.testWidget", {
+ method: function( str ) {
+ strictEqual( this, instance, "original invoked with correct this" );
+ equal( str, "bar", "original invoked with correct parameter" );
+ }
+ });
+ $.ui.testWidget.foo = "bar";
+ $.widget( "ui.testWidget", $.ui.testWidget, {
+ method: function( str ) {
+ equal( str, "foo", "new invoked with correct parameter" );
+ this._super( "bar" );
+ }
+ });
+
+ var instance = new $.ui.testWidget();
+ instance.method( "foo" );
+ equal( $.ui.testWidget.foo, "bar", "static properties remain" );
+});
+
+asyncTest( "_delay", function() {
+ expect( 6 );
+ var order = 0,
+ that;
+ $.widget( "ui.testWidget", {
+ defaultElement: null,
+ _create: function() {
+ that = this;
+ var timer = this._delay(function() {
+ strictEqual( this, that );
+ equal( order, 1 );
+ start();
+ }, 500);
+ ok( timer !== undefined );
+ timer = this._delay("callback");
+ ok( timer !== undefined );
+ },
+ callback: function() {
+ strictEqual( this, that );
+ equal( order, 0 );
+ order += 1;
+ }
+ });
+ $( "#widget" ).testWidget();
+});
+
+}( jQuery ) );
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js
new file mode 100644
index 0000000..90e686e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js
@@ -0,0 +1,103 @@
+test( "$.widget.extend()", function() {
+ expect( 26 );
+
+ var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+ options = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
+ optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
+ merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" },
+ deep1 = { foo: { bar: true } },
+ deep2 = { foo: { baz: true }, foo2: document },
+ deep2copy = { foo: { baz: true }, foo2: document },
+ deepmerged = { foo: { bar: true, baz: true }, foo2: document },
+ arr = [1, 2, 3],
+ nestedarray = { arr: arr },
+ ret;
+
+ $.widget.extend( settings, options );
+ deepEqual( settings, merged, "Check if extended: settings must be extended" );
+ deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" );
+
+ $.widget.extend( deep1, deep2 );
+ deepEqual( deep1.foo, deepmerged.foo, "Check if foo: settings must be extended" );
+ deepEqual( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" );
+ equal( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" );
+
+ strictEqual( $.widget.extend({}, nestedarray).arr, arr, "Don't clone arrays" );
+ ok( $.isPlainObject( $.widget.extend({ arr: arr }, { arr: {} }).arr ), "Cloned object heve to be an plain object" );
+
+ var empty = {};
+ var optionsWithLength = { foo: { length: -1 } };
+ $.widget.extend( empty, optionsWithLength );
+ deepEqual( empty.foo, optionsWithLength.foo, "The length property must copy correctly" );
+
+ empty = {};
+ var optionsWithDate = { foo: { date: new Date } };
+ $.widget.extend( empty, optionsWithDate );
+ deepEqual( empty.foo, optionsWithDate.foo, "Dates copy correctly" );
+
+ var myKlass = function() {};
+ var customObject = new myKlass();
+ var optionsWithCustomObject = { foo: { date: customObject } };
+ empty = {};
+ $.widget.extend( empty, optionsWithCustomObject );
+ strictEqual( empty.foo.date, customObject, "Custom objects copy correctly (no methods)" );
+
+ // Makes the class a little more realistic
+ myKlass.prototype = { someMethod: function(){} };
+ empty = {};
+ $.widget.extend( empty, optionsWithCustomObject );
+ strictEqual( empty.foo.date, customObject, "Custom objects copy correctly" );
+
+ ret = $.widget.extend({ foo: 4 }, { foo: new Number(5) } );
+ equal( ret.foo, 5, "Wrapped numbers copy correctly" );
+
+ var nullUndef;
+ nullUndef = $.widget.extend( {}, options, { xnumber2: null } );
+ strictEqual( nullUndef.xnumber2, null, "Check to make sure null values are copied");
+
+ nullUndef = $.widget.extend( {}, options, { xnumber2: undefined } );
+ strictEqual( nullUndef.xnumber2, options.xnumber2, "Check to make sure undefined values are not copied");
+
+ nullUndef = $.widget.extend( {}, options, { xnumber0: null } );
+ strictEqual( nullUndef.xnumber0, null, "Check to make sure null values are inserted");
+
+ var target = {};
+ var recursive = { foo:target, bar:5 };
+ $.widget.extend( target, recursive );
+ deepEqual( target, { foo: {}, bar: 5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" );
+
+ ret = $.widget.extend( { foo: [] }, { foo: [0] } ); // 1907
+ equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" );
+
+ ret = $.widget.extend( { foo: "1,2,3" }, { foo: [1, 2, 3] } );
+ strictEqual( typeof ret.foo, "object", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" );
+
+ ret = $.widget.extend( { foo:"bar" }, { foo:null } );
+ strictEqual( typeof ret.foo, "object", "Make sure a null value doesn't crash with deep extend, for #1908" );
+
+ var obj = { foo:null };
+ $.widget.extend( obj, { foo:"notnull" } );
+ equal( obj.foo, "notnull", "Make sure a null value can be overwritten" );
+
+ var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+ defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+ options1 = { xnumber2: 1, xstring2: "x" },
+ options1Copy = { xnumber2: 1, xstring2: "x" },
+ options2 = { xstring2: "xx", xxx: "newstringx" },
+ options2Copy = { xstring2: "xx", xxx: "newstringx" },
+ merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" };
+
+ var settings = $.widget.extend( {}, defaults, options1, options2 );
+ deepEqual( settings, merged2, "Check if extended: settings must be extended" );
+ deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" );
+ deepEqual( options1, options1Copy, "Check if not modified: options1 must not be modified" );
+ deepEqual( options2, options2Copy, "Check if not modified: options2 must not be modified" );
+
+ var input = {
+ key: [ 1, 2, 3 ]
+ };
+ var output = $.widget.extend( {}, input );
+ deepEqual( input, output, "don't clone arrays" );
+ input.key[0] = 10;
+ deepEqual( input, output, "don't clone arrays" );
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html
new file mode 100644
index 0000000..c00101b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>addClass Visual Test : Queue</title>
+ <link rel="stylesheet" href="../visual.css">
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
+ <script src="../../../jquery-1.7.1.js"></script>
+ <script src="../../../ui/jquery.effects.core.js"></script>
+ <style>
+ .box {
+ width: 100px;
+ height: 100px;
+ background-color: #000;
+ }
+ .red {
+ background-color: #f00;
+ }
+ .green {
+ background-color: #0f0;
+ }
+ .blue {
+ background-color: #00f;
+ }
+ </style>
+ <script>
+ $(function() {
+ $( "#box1" )
+ .delay( 500 )
+ .addClass( "red", 2000 )
+ .delay( 500 )
+ .addClass( "green", 2000 )
+ .delay( 500 )
+ .addClass( "blue", 2000 );
+ $( "#box2" )
+ .addClass( "red", 2000 )
+ .delay( 500 )
+ .addClass( "green", 2000 )
+ .delay( 500 )
+ .addClass( "blue", 2000 );
+ });
+ </script>
+</head>
+<body>
+
+<div id="box1" class="box"></div>
+<div id="box2" class="box"></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html
new file mode 100644
index 0000000..e93c795
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual push: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <style type="text/css">
+ #toolbar { margin-top: 2em; padding:0.2em; }
+ #ops1, #ops2, #format, #mode { margin-right: 1em }
+ </style>
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../external/jquery.metadata.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ var buttons = $('#push button, #check').button();
+ var buttonSets = $('#radio0, #radio1, #radio2, #ops1, #format, #ops2, #mode, #inputs, #anchors').buttonset();
+
+ buttons.add(buttonSets).click(function(event) {
+ var target = $(event.target);
+ if (target.closest('.ui-button:not(.ui-state-disabled)').length) {
+ $("<div></div>")
+ .text("Clicked " + (target.text() || target.val()))
+ .appendTo("#log");
+ window.console && console.log(this, arguments);
+ }
+ });
+
+ $("#disable-widgets").toggle(function() {
+ buttons.button("disable");
+ buttonSets.buttonset("disable");
+ }, function() {
+ buttons.button("enable");
+ buttonSets.buttonset("enable");
+ });
+ $("#toggle-widgets").toggle(function() {
+ buttons.button();
+ buttonSets.buttonset();
+ }, function() {
+ buttons.button("destroy");
+ buttonSets.buttonset("destroy");
+ }).click();
+ });
+ </script>
+</head>
+<body>
+
+<div id="push">
+ <div>
+ No icon
+ <button>Simple button, only text</button>
+ <button class="ui-priority-secondary">Secondary priority button</button>
+ </div>
+ <br/>
+ <div>
+ With icon
+ <button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+ <button class="{button:{icons:{primary:'ui-icon-locked'}}}">Primary icon</button>
+ <button class="{button:{icons:{secondary:'ui-icon-triangle-1-s'}}}">Secondary icon</button>
+ <button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Both icons</button>
+ <button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons and no text</button>
+ </div>
+</div>
+
+<div id="toggle" style="margin-top: 2em;">
+ <input type="checkbox" id="check" /><label for="check">Toggle</label>
+</div>
+
+<div id="radio0" style="margin-top: 2em;">
+ <input type="radio" id="radio01" name="radio" checked="checked" /><label for="radio01">Choice 1</label>
+ <input type="radio" id="radio02" name="radio" /><label for="radio02">Choice 2</label>
+ <input type="radio" id="radio03" name="radio" /><label for="radio03">Choice 3</label>
+</div>
+<form>
+ <div id="radio1" style="margin-top: 2em;">
+ <input type="radio" id="radio11" name="radio" /><label for="radio11">Choice 1</label>
+ <input type="radio" id="radio12" name="radio" checked="checked" /><label for="radio12">Choice 2</label>
+ <input type="radio" id="radio13" name="radio" /><label for="radio13">Choice 3</label>
+ </div>
+</form>
+<form>
+ <div id="radio2" style="margin-top: 2em;">
+ <input type="radio" id="radio21" name="radio" /><label for="radio21">Choice 1</label>
+ <input type="radio" id="radio22" name="radio" /><label for="radio22">Choice 2</label>
+ <input type="radio" id="radio23" name="radio" checked="checked" /><label for="radio23">Choice 3</label>
+ </div>
+</form>
+
+<div id="toolbar" class="ui-widget-header ui-corner-all ui-helper-clearfix">
+ <span id="ops1">
+ <button class="{button:{icons:{primary:'ui-icon-folder-open'},text:false}}">Open</button>
+ <button class="{button:{icons:{primary:'ui-icon-disk'},text:false}}">Save</button>
+ <button class="{button:{icons:{primary:'ui-icon-trash'},text:false}}">Delete</button>
+ </span>
+ <span id="format">
+ <input type="checkbox" id="check1" /><label for="check1">B</label>
+ <input type="checkbox" id="check2" /><label for="check2">I</label>
+ <input type="checkbox" id="check3" /><label for="check3">U</label>
+ </span>
+ <span id="ops2">
+ <button class="{button:{icons:{primary:'ui-icon-print'},text:false}}">Print...</button>
+ <button class="{button:{icons:{primary:'ui-icon-mail-closed'},text:false}}">Mail to...</button>
+ </span>
+ <span id="mode">
+ <input type="radio" id="mode1" name="radio2" checked="checked" /><label for="mode1">Edit</label>
+ <input type="radio" id="mode2" name="radio2" /><label for="mode2">View</label>
+ </span>
+</div>
+
+<div id="inputs" style="margin-top: 2em;">
+ <input type="submit" value="Submit button" />
+ <input type="reset" value="Reset button" class="{button:{label:'Custom reset'}}" />
+</div>
+
+<div id="anchors" style="margin-top: 2em;">
+ <a href="#">Anchor 1</a>
+ <a href="#" class="{button:{icons:{primary:'ui-icon-print'},text:false}}">Anchor 2</a>
+ <a href="#" class="{button:{icons:{primary:'ui-icon-mail-closed'},text:false}}">Anchor 3</a>
+ <a href="#">Anchor 4</a>
+</div>
+
+<div style="margin-top: 2em;">
+ <button id="disable-widgets">Toggle disabled</button>
+ <button id="toggle-widgets">Toggle widget</button>
+</div>
+<div id="log"></div>
+
+<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+<script type="text/javascript">
+ $.fn.themeswitcher && $('<div></div>').css({
+ position: "absolute",
+ right: 10,
+ top: 10
+ }).appendTo(document.body).themeswitcher();
+</script>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html
new file mode 100644
index 0000000..ac21a56
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual Test : Button disabled true</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+
+ $("#button1").button({
+ disabled: true
+ });
+
+ $("#anchor1").button({
+ disabled: true
+ });
+
+ $("#inputbutton1").button({
+ disabled: true
+ });
+
+ $("#radio1, #radio2, #radio3").button({
+ disabled: true
+ });
+
+ $("#checkbox1, #checkbox2, #checkbox3").button({
+ disabled: true
+ });
+
+ });
+ </script>
+</head>
+<body>
+
+<fieldset>
+ <legend>button</legend>
+ <button disabled="disabled">button</button>
+ <hr />
+ <button id="button1">button</button>
+</fieldset>
+
+<fieldset>
+ <legend>anchor</legend>
+ <a href="javascript:void(0)" disabled="disabled">anchor 1</a>
+ <hr />
+ <a href="javascript:void(0)" id="anchor1">anchor 1</a>
+</fieldset>
+
+<fieldset>
+ <legend>input type="button"</legend>
+ <input type="button" disabled="disabled" value="input button 1" />
+ <hr />
+ <input type="button" id="inputbutton1" value="input button 1" />
+</fieldset>
+
+<fieldset>
+ <legend>input type="radio"</legend>
+ <input type="radio" name="radioletter" id="radioa" disabled="disabled" /><label for="radioa">radio a</label>
+ <input type="radio" name="radioletter" id="radiob" disabled="disabled" /><label for="radiob">radio b</label>
+ <input type="radio" name="radioletter" id="radioc" disabled="disabled" /><label for="radioc">radio c</label>
+ <hr />
+ <input type="radio" name="radionumber" id="radio1" /><label for="radio1">radio 1</label>
+ <input type="radio" name="radionumber" id="radio2" /><label for="radio2">radio 2</label>
+ <input type="radio" name="radionumber" id="radio3" /><label for="radio3">radio 3</label>
+</fieldset>
+
+<fieldset>
+ <legend>input type="checkbox"</legend>
+ <input type="checkbox" id="checkboxa" disabled="disabled" /><label for="checkboxa">checkbox a</label>
+ <input type="checkbox" id="checkboxb" disabled="disabled" /><label for="checkboxb">checkbox b</label>
+ <input type="checkbox" id="checkboxc" disabled="disabled" /><label for="checkboxc">checkbox c</label>
+ <hr />
+ <input type="checkbox" id="checkbox1" /><label for="checkbox1">checkbox 1</label>
+ <input type="checkbox" id="checkbox2" /><label for="checkbox2">checkbox 2</label>
+ <input type="checkbox" id="checkbox3" /><label for="checkbox3">checkbox 3</label>
+</fieldset>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html
new file mode 100644
index 0000000..439e2c1
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html
@@ -0,0 +1,555 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual push: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <style type="text/css">
+ #toolbar { margin-top: 2em; padding:0.2em; }
+ #ops1, #ops2, #format, #mode { margin-right: 1em }
+ </style>
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../external/jquery.metadata.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ var start = +new Date();
+ $("button").button();
+ var end = +new Date();
+ $("<p></p>").text( "Time to initialize: " + (end - start) + "ms" ).prependTo("body");
+ });
+ </script>
+</head>
+<body>
+
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+<button>Simple button, only text</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
+<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
+<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html
new file mode 100644
index 0000000..14d2769
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual Test : Button ticket #5254</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+
+ $('#b1').button();
+
+ $('#b2').button();
+
+ $('#b3').button().click(function() {
+ return false;
+ });
+
+ $('#ua').text(navigator.userAgent);
+
+ });
+ </script>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/5254">#5254 - Input, button and anchor buttons aren't consistent in IE7</a></h1>
+
+<dl>
+<dt><h2>Screenshot from ticket:</h2></dt>
+<dd><img src="http://dev.jqueryui.com/raw-attachment/ticket/5254/button.png"></dd>
+</dl>
+
+<hr>
+
+<dl>
+<dt><h2>Visual test:</h2></dt>
+<dd>
+ <div id="vt">
+ <input id="b1" type="button" value="Input" style="" />
+ <button id="b2">Button</button>
+ <a id="b3" href="#">Anchor</a>
+ </div>
+</dd>
+<dt><h2>User agent:</h2></dt>
+<dd>
+ <h3 id="ua"></h3>
+</dd>
+</dl>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html
new file mode 100644
index 0000000..0024393
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual Test : Button ticket #5261</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+
+ $('#id1').button().change(function(e) {
+ console.log('change', e);
+ });
+ $('#id1').bind('change', function(e) {
+ console.log('bound change', e);
+ });
+ $("body").live('change', function(e) {
+ console.log('live change on body', e);
+ });
+ $(document).delegate('input', 'change', function(e) {
+ console.log('delegated input change', e);
+ });
+ $(document).change(function(e) {
+ console.log('delegated change on document', e);
+ });
+
+ });
+ </script>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/5261">#5261 - button change events don't fire in IE 7/8</a></h1>
+
+<input name="1" id="id1" type="checkbox"/>
+<label for="id1">Checkbox</label>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html
new file mode 100644
index 0000000..477a0b3
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Button Visual Test : Button ticket #5278</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript">
+ $(function() {
+
+ $('#id1, #id2, #id3, #id4').button();
+
+ $('#r1, #r2, #r3, #r4').button();
+
+ });
+ </script>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/5278">#5278 - ui.buttons doesn't visually reset on form "reset" event or input "change" event</a></h1>
+
+<form>
+
+<input name="a1" id="id1" type="checkbox"/>
+<label for="id1">Checkbox</label>
+
+<input name="a2" id="id2" type="checkbox"/>
+<label for="id2">Checkbox</label>
+
+<input name="a3" id="id3" type="checkbox" checked="checked" />
+<label for="id3">Checkbox</label>
+
+<input name="a4" id="id4" type="checkbox"/>
+<label for="id4">Checkbox</label>
+
+<input type="reset"/>
+
+<input name="r" id="r1" type="radio"/>
+<label for="r1">Radio</label>
+
+<input name="r" id="r2" type="radio"/>
+<label for="r2">Radio</label>
+
+<input name="r" id="r3" type="radio" checked="checked" />
+<label for="r3">Radio</label>
+
+<input name="r" id="r4" type="radio"/>
+<label for="r4">Radio</label>
+
+
+</form>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html
new file mode 100644
index 0000000..7b3b227
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Accordion in Dialog</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $('#accordion').accordion({
+ collapsible: true,
+ active: false
+ });
+ $('#dialog').dialog({
+ buttons: {
+ Test: $.noop
+ }
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div id="dialog">
+ <div id="accordion">
+ <h3><a href="#">Section 1</a></h3>
+ <div>
+ <p>
+ Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
+ ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
+ amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
+ odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
+ </p>
+ </div>
+ <h3><a href="#">Section 2</a></h3>
+ <div>
+ <p>
+ Cras dictum. Pellentesque habitant morbi tristique senectus et netus
+ et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
+ faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
+ mauris vel est.
+ </p>
+ <p>
+ Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
+ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
+ inceptos himenaeos.
+ </p>
+ </div>
+ <h3><a href="#">Section 3</a></h3>
+ <div>
+ <p>
+ Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
+ Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
+ ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
+ lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
+ </p>
+ <ul>
+ <li>List item one</li>
+ <li>List item two</li>
+ <li>List item three</li>
+ </ul>
+ </div>
+ </div>
+</div>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html
new file mode 100644
index 0000000..e98edaf
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Accordion in Tabs</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $('#tabs').tabs();
+ $('#accordion-1, #accordion-2').accordion();
+ });
+ </script>
+</head>
+<body>
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="accordion-1">
+ <h3><a href="#">Accordion Header 1</a></h3>
+ <div>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ </div>
+ <h3><a href="#">Accordion Header 2</a></h3>
+ <div>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ </div>
+ <h3><a href="#">Accordion Header 3</a></h3>
+ <div>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ </div>
+ </div>
+ </div>
+ <div id="tabs-2">
+ <div id="accordion-2">
+ <h3><a href="#">Accordion Header 1</a></h3>
+ <div>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ </div>
+ <h3><a href="#">Accordion Header 2</a></h3>
+ <div>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ </div>
+ <h3><a href="#">Accordion Header 3</a></h3>
+ <div>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ </div>
+ </div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html
new file mode 100644
index 0000000..0ef3f9b
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Datepicker in Dialog</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $('#datepicker').datepicker();
+ $('#dialog').dialog();
+ });
+ </script>
+</head>
+<body>
+
+<div id="dialog">
+ <input id="datepicker">
+</div>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html
new file mode 100644
index 0000000..396d0e2
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Draggable in Accordion</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <style type="text/css">
+ .draggable {
+ width: 10em;
+ margin: 0.5em;
+ }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $( "#accordion" ).accordion();
+ $( ".draggable" ).addClass( "ui-widget ui-widget-content ui-corner-all" )
+ $( "#first .draggable" ).draggable();
+ $( "#second .draggable" ).draggable({
+ appendTo: "body"
+ });
+ $( "#third .draggable" ).draggable({
+ helper: "clone",
+ appendTo: "body"
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div id="accordion">
+ <h3><a href="#">.draggable()</a></h3>
+ <div id="first">
+ <div class="draggable">Draggable 1-1</div>
+ <div class="draggable">Draggable 1-2</div>
+ <div class="draggable">Draggable 1-3</div>
+ <div class="draggable">Draggable 1-4</div>
+ <div class="draggable">Draggable 1-5</div>
+ </div>
+ <h3><a href="#">.draggable({ appendTo: "body" })</a></h3>
+ <div id="second">
+ <div class="draggable">Draggable 2-1</div>
+ <div class="draggable">Draggable 2-2</div>
+ <div class="draggable">Draggable 2-3</div>
+ <div class="draggable">Draggable 2-4</div>
+ <div class="draggable">Draggable 2-5</div>
+ </div>
+ <h3><a href="#">.draggable({ helper: "clone", appendTo: "body" })</a></h3>
+ <div id="third">
+ <div class="draggable">Draggable 3-1</div>
+ <div class="draggable">Draggable 3-2</div>
+ <div class="draggable">Draggable 3-3</div>
+ <div class="draggable">Draggable 3-4</div>
+ <div class="draggable">Draggable 3-5</div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html
new file mode 100644
index 0000000..a1199c8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Draggable in Accordion</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <style type="text/css">
+ #main-draggable {
+ width: 300px;
+ position: absolute;
+ right: 100px;
+ }
+ #main-draggable-handle {
+ padding: 1em;
+ margin: 0;
+ }
+ .draggable {
+ width: 10em;
+ margin: 0.5em;
+ }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $( ".draggable" ).addClass( "ui-widget ui-widget-content ui-corner-all" )
+ $( ".draggable" ).draggable({
+ helper: "clone",
+ appendTo: "body"
+ });
+
+ // PROBLEM: nested accordions must be initialized before outer accordion
+ $( "#accordion > div" ).accordion();
+ $( "#accordion" ).accordion();
+
+
+ // PROBLEM: nested widgets must be initialized before tabs
+ $( "#tabs" ).tabs();
+
+ $( "#main-draggable" ).draggable({
+ handle: "#main-draggable-handle"
+ });
+ });
+ </script>
+</head>
+<body>
+<div id="main-draggable" class="ui-widget ui-widget-content ui-corner-all">
+ <p id="main-draggable-handle" class="ui-widget-header ui-corner-all">Drag me around!</p>
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First Tab</a></li>
+ <li><a href="#tabs-2">Second Tab</a></li>
+ </ul>
+ <div id="tabs-1">
+ <p>Click the other tab!</p>
+ </div>
+ <div id="tabs-2">
+ <div id="accordion">
+ <h3><a>Accordion Group 1</a></h3>
+ <div id="accordion-1-1">
+ <h3><a href="#">Header 1-1</a></h3>
+ <div>
+ <div class="draggable">Draggable 1-1</div>
+ <div class="draggable">Draggable 1-2</div>
+ <div class="draggable">Draggable 1-3</div>
+ <div class="draggable">Draggable 1-4</div>
+ <div class="draggable">Draggable 1-5</div>
+ </div>
+ <h3><a href="#">Header 1-2</a></h3>
+ <div>
+ <div class="draggable">Draggable 2-1</div>
+ <div class="draggable">Draggable 2-2</div>
+ <div class="draggable">Draggable 2-3</div>
+ <div class="draggable">Draggable 2-4</div>
+ <div class="draggable">Draggable 2-5</div>
+ </div>
+ </div>
+ <h3><a>Accordion Group 2</a></h3>
+ <div id="accordion-1-2">
+ <h3><a href="#">Header 2-1</a></h3>
+ <div>
+ <div class="draggable">Draggable 1-1</div>
+ <div class="draggable">Draggable 1-2</div>
+ <div class="draggable">Draggable 1-3</div>
+ <div class="draggable">Draggable 1-4</div>
+ <div class="draggable">Draggable 1-5</div>
+ </div>
+ <h3><a href="#">Header 2-2</a></h3>
+ <div>
+ <div class="draggable">Draggable 2-1</div>
+ <div class="draggable">Draggable 2-2</div>
+ <div class="draggable">Draggable 2-3</div>
+ <div class="draggable">Draggable 2-4</div>
+ <div class="draggable">Draggable 2-5</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html
new file mode 100644
index 0000000..02a6c0d
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Accordion in Tabs</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.sortable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $( "#accordion-1, #accordion-2" )
+ .accordion({
+ header: "> div > h3"
+ })
+ .sortable();
+
+ $( "#tabs" )
+ .tabs()
+ .find( ".ui-tabs-nav" )
+ .sortable();
+ });
+ </script>
+</head>
+<body>
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="accordion-1">
+ <div>
+ <h3><a href="#">Accordion Header 1</a></h3>
+ <div>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ </div>
+ </div>
+ <div>
+ <h3><a href="#">Accordion Header 2</a></h3>
+ <div>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ </div>
+ </div>
+ <div>
+ <h3><a href="#">Accordion Header 3</a></h3>
+ <div>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="tabs-2">
+ <div id="accordion-1">
+ <div>
+ <h3><a href="#">Accordion Header 1</a></h3>
+ <div>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ <p>Accordion Content 1</p>
+ </div>
+ </div>
+ <div>
+ <h3><a href="#">Accordion Header 2</a></h3>
+ <div>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ <p>Accordion Content 2</p>
+ </div>
+ </div>
+ <div>
+ <h3><a href="#">Accordion Header 3</a></h3>
+ <div>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ <p>Accordion Content 3</p>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html
new file mode 100644
index 0000000..12515a4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Tabs in Tabs</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $('#tabs, #tabs-a, #tabs-b').tabs();
+ });
+ </script>
+</head>
+<body>
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="tabs-a">
+ <ul>
+ <li><a href="#tabs-a-1">First</a></li>
+ <li><a href="#tabs-a-2">Second</a></li>
+ </ul>
+ <div id="tabs-a-1">
+ <p>nested tabs a-1</p>
+ <p>nested tabs a-1</p>
+ <p>nested tabs a-1</p>
+ <p>nested tabs a-1</p>
+ <p>nested tabs a-1</p>
+ </div>
+ <div id="tabs-a-2">
+ <p>nested tabs a-2</p>
+ <p>nested tabs a-2</p>
+ <p>nested tabs a-2</p>
+ <p>nested tabs a-2</p>
+ <p>nested tabs a-2</p>
+ </div>
+ </div>
+ </div>
+ <div id="tabs-2">
+ <div id="tabs-b">
+ <ul>
+ <li><a href="#tabs-b-1">First</a></li>
+ <li><a href="#tabs-b-2">Second</a></li>
+ </ul>
+ <div id="tabs-b-1">
+ <p>nested tabs b-1</p>
+ <p>nested tabs b-1</p>
+ <p>nested tabs b-1</p>
+ <p>nested tabs b-1</p>
+ <p>nested tabs b-1</p>
+ </div>
+ <div id="tabs-b-2">
+ <p>nested tabs b-2</p>
+ <p>nested tabs b-2</p>
+ <p>nested tabs b-2</p>
+ <p>nested tabs b-2</p>
+ <p>nested tabs b-2</p>
+ </div>
+ </div>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html
new file mode 100644
index 0000000..38b85e5
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : Tabs in Tabs</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $("#tabs").tabs();
+ $("a").tooltip();
+ });
+ </script>
+</head>
+<body>
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1" title="first tab tooltip">First</a></li>
+ <li><a href="#tabs-2" title="second tab tooltip">Second</a></li>
+ </ul>
+ <div id="tabs-1">
+ <a href="#" title="title content">label</a>
+ </div>
+ <div id="tabs-2">
+ <a href="#" title="other title content">other label</a>
+ </div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html
new file mode 100644
index 0000000..b711efa
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html
@@ -0,0 +1,229 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound Visual Test : All Widgets in Dialog</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.autocomplete.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.progressbar.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.slider.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $("[title]").tooltip();
+
+ $("#accordion").accordion();
+ $("#autocomplete").autocomplete({
+ source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]
+ });
+ $("button").button().click(function() {
+ $("#dialog2").dialog("open");
+ });
+ $("#datepicker").datepicker();
+ $("#progressbar").progressbar({
+ value: 30
+ });
+ $("#slider").slider({
+ // should be animated
+ animate: true,
+ value: 30,
+ slide: function(event, ui) {
+ $("#progress").val(ui.value);
+ $("#progressbar").progressbar("option", "value", ui.value);
+ }
+ });
+ $("#tabs").tabs();
+
+ $("#dialog").dialog();
+ $("#dialog2").dialog({
+ autoOpen: false,
+ width: 100,
+ height: 75,
+ modal: true
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div id="dialog">
+ <div id="accordion">
+ <h3><a href="#">Accordion Header 1</a></h3>
+ <div>
+ Accordion Content 1
+ </div>
+ <h3><a href="#">Accordion Header 2</a></h3>
+ <div>
+ Accordion Content 2
+ </div>
+ <h3><a href="#">Accordion Header 3</a></h3>
+ <div>
+ Accordion Content 3
+ </div>
+ </div>
+ <input id="autocomplete">
+ <button>A Button</button>
+ <input id="datepicker">
+ <button>Another button</button>
+ <div>
+ <label for="progress">Progress: <input title="The progress we made so far" id="progress" /></label>
+ </div>
+ <div id="progressbar">
+ </div>
+ <div id="slider" title="Sliding progress..."></div>
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ <li><a href="#tabs-3">Third</a></li>
+ </ul>
+ <div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
+ <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
+ <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
+ </div>
+</div>
+<div id="dialog2">
+ Yay, another dialog.
+</div>
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar.
+</p>
+<p>
+Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci.
+</p>
+<p>
+Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida.
+</p>
+<p>
+Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper.
+</p>
+<p>
+Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor.
+</p>
+<p>
+
+Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi.
+</p>
+<p>
+Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae.
+</p>
+<p>
+Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat.
+</p>
+<p>
+Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna.
+</p>
+<p>
+Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc.
+</p>
+<p>
+Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod.
+</p>
+
+<p>
+Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
+</p>
+<p>
+Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis.
+</p>
+<p>
+Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis.
+</p>
+<p>
+In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est.
+</p>
+<p>
+Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat.
+</p>
+<p>
+Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida.
+
+</p>
+<p>
+Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl.
+</p>
+<p>
+Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia.
+</p>
+<p>
+Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis.
+</p>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html
new file mode 100644
index 0000000..c7c1056
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html
@@ -0,0 +1,2963 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Dialog Visual Test : Modal Dialog in Large DOM</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../external/jquery.bgiframe-2.1.2.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $("#dialog").dialog({
+ modal: true,
+ autoOpen: false
+ });
+ $('#opener').click(function() {
+ $('#dialog').dialog('open');
+ });
+ });
+ </script>
+</head>
+<body>
+
+<button id="opener">open dialog</button>
+<div id="dialog" title="Dialog Title">
+ <p> Dialog Content </p>
+ <input type="text">
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+<div>
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="checkbox"><input type="checkbox"><input type="checkbox">
+<select>
+ <option value="a">option</option>
+ <option value="b">option</option>
+ <option value="c">option</option>
+ <option value="d">option</option>
+ <option value="e">option</option>
+ <option value="f">option</option>
+ <option value="g">option</option>
+ <option value="h">option</option>
+ <option value="i">option</option>
+</select>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css
new file mode 100644
index 0000000..1d531b0
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css
@@ -0,0 +1,55 @@
+
+body,html {
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
+ font-family: Arial;
+ background: #191919;
+ color: #fff;
+}
+body { margin: 1em; }
+
+ul.effects {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+
+ul.effects li {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ width: 120px;
+ height: 100px;
+ float: left;
+ margin-top: 20px;
+ margin-left: 20px;
+}
+
+div.effect {
+ width: 120px;
+ height: 100px;
+ background: #ccc;
+ border: 5px outset #aaa;
+ float: left;
+ cursor: pointer;
+ cursor: hand;
+}
+
+div.current {
+ border: 5px outset #FF9C08;
+ background: #FF9C08;
+}
+
+div.effect p {
+ color: #191919;
+ font-weight: bold;
+ margin: 0px;
+ padding: 10px;
+}
+
+.ui-effects-transfer {
+ border: 1px dotted #fff;
+ background: #666;
+ opacity: 0.5;
+}
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html
new file mode 100644
index 0000000..ddc6654
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html
@@ -0,0 +1,217 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Effects Test Suite</title>
+ <link rel="stylesheet" href="effects.all.css" type="text/css">
+ <script src="../../../jquery-1.7.1.js"></script>
+ <script src="../../../ui/jquery.effects.core.js"></script>
+ <script src="../../../ui/jquery.effects.blind.js"></script>
+ <script src="../../../ui/jquery.effects.bounce.js"></script>
+ <script src="../../../ui/jquery.effects.clip.js"></script>
+ <script src="../../../ui/jquery.effects.drop.js"></script>
+ <script src="../../../ui/jquery.effects.explode.js"></script>
+ <script src="../../../ui/jquery.effects.fade.js"></script>
+ <script src="../../../ui/jquery.effects.fold.js"></script>
+ <script src="../../../ui/jquery.effects.highlight.js"></script>
+ <script src="../../../ui/jquery.effects.pulsate.js"></script>
+ <script src="../../../ui/jquery.effects.scale.js"></script>
+ <script src="../../../ui/jquery.effects.shake.js"></script>
+ <script src="../../../ui/jquery.effects.slide.js"></script>
+ <script src="../../../ui/jquery.effects.transfer.js"></script>
+ <script src="effects.all.js"></script>
+</head>
+<body>
+
+<ul class="effects">
+
+ <li>
+ <div class="effect" id="blindUp">
+ <p>Blind up</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="blindDown">
+ <p>Blind down</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="blindLeft">
+ <p>Blind left</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="blindRight">
+ <p>Blind right</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="bounce3times">
+ <p>Bounce 3 times</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="clipHorizontally">
+ <p>Clip horizontally</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="clipVertically">
+ <p>Clip vertically</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="dropDown">
+ <p>Drop down</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="dropUp">
+ <p>Drop up</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="dropLeft">
+ <p>Drop left</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="dropRight">
+ <p>Drop right</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="explode9">
+ <p>Explode in 9 pieces</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="explode36">
+ <p>Explode in 36 pieces</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="fade">
+ <p>Fade</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="fold">
+ <p>Fold</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="highlight">
+ <p>Highlight</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="pulsate">
+ <p>Pulsate 2 times</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="puff">
+ <p>Puff</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="scale">
+ <p>Scale</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="shake">
+ <p>Shake</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="size">
+ <p>Size Default Show/Hide</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="sizeToggle">
+ <p>Size Toggle</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="slideDown">
+ <p>Slide down</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="slideUp">
+ <p>Slide up</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="slideLeft">
+ <p>Slide left</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="slideRight">
+ <p>Slide right</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="transfer">
+ <p>Transfer to first element</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="addClass">
+ <p>addClass</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="removeClass">
+ <p>removeClass</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="toggleClass">
+ <p>toggleClass</p>
+ </div>
+ </li>
+
+ <li>
+ <div class="effect" id="hide">
+ <p>hide/show (jQuery)</p>
+ </div>
+ </li>
+
+</ul>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js
new file mode 100644
index 0000000..a28c41a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js
@@ -0,0 +1,106 @@
+
+$(function() {
+ var duration = 1000, wait = 500;
+
+ $("div.effect")
+ .hover(function() { $(this).addClass("hover"); },
+ function() { $(this).removeClass("hover"); });
+
+ var effect = function(el, n, o) {
+
+ $.extend(o, {
+ easing: "easeOutQuint"
+ });
+
+ $(el).bind("click", function() {
+
+ $(this).addClass("current")
+ // delaying the initial animation makes sure that the queue stays in tact
+ .delay( 10 )
+ .hide( n, o, duration )
+ .delay( wait )
+ .show( n, o, duration, function() {
+ $( this ).removeClass("current");
+ });
+ });
+
+ };
+
+ $("#hide").click(function() {
+ var el = $(this);
+ el.addClass("current").hide(duration, function() {
+ setTimeout(function() {
+ el.show(duration, function() { el.removeClass("current"); });
+ }, wait);
+ });
+ });
+
+ effect("#blindLeft", "blind", { direction: "left" });
+ effect("#blindUp", "blind", { direction: "up" });
+ effect("#blindRight", "blind", { direction: "right" });
+ effect("#blindDown", "blind", { direction: "down" });
+
+ effect("#bounce3times", "bounce", { times: 3 });
+
+ effect("#clipHorizontally", "clip", { direction: "horizontal" });
+ effect("#clipVertically", "clip", { direction: "vertical" });
+
+ effect("#dropDown", "drop", { direction: "down" });
+ effect("#dropUp", "drop", { direction: "up" });
+ effect("#dropLeft", "drop", { direction: "left" });
+ effect("#dropRight", "drop", { direction: "right" });
+
+ effect("#explode9", "explode", {});
+ effect("#explode36", "explode", { pieces: 36 });
+
+ effect("#fade", "fade", {});
+
+ effect("#fold", "fold", { size: 50 });
+
+ effect("#highlight", "highlight", {});
+
+ effect("#pulsate", "pulsate", { times: 2 });
+
+ effect("#puff", "puff", { times: 2 });
+ effect("#scale", "scale", {});
+ effect("#size", "size", {});
+ $("#sizeToggle").bind("click", function() {
+ var opts = { to: { width: 300, height: 300 }};
+ $(this).addClass('current')
+ .toggle("size", opts, duration)
+ .delay(wait)
+ .toggle("size", opts, duration, function() {
+ $(this).removeClass("current");
+ });
+ });
+
+ $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); });
+
+ effect("#slideDown", "slide", { direction: "down" });
+ effect("#slideUp", "slide", { direction: "up" });
+ effect("#slideLeft", "slide", { direction: "left" });
+ effect("#slideRight", "slide", { direction: "right" });
+
+ $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); });
+
+ $("#addClass").click(function() {
+ $(this).addClass(function() {
+ window.console && console.log(arguments);
+ return "current";
+ }, duration, function() {
+ $(this).removeClass("current");
+ });
+ });
+ $("#removeClass").click(function() {
+ $(this).addClass("current").removeClass(function() {
+ window.console && console.log(arguments);
+ return "current";
+ }, duration);
+ });
+ $("#toggleClass").click(function() {
+ $(this).toggleClass(function() {
+ window.console && console.log(arguments);
+ return "current";
+ }, duration);
+ });
+});
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html
new file mode 100644
index 0000000..845625e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html
@@ -0,0 +1,159 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Effects Test Suite</title>
+ <link rel="stylesheet" href="effects.all.css" type="text/css">
+ <script src="../../../jquery-1.7.1.js"></script>
+ <script src="../../../ui/jquery.effects.core.js"></script>
+ <script src="../../../ui/jquery.effects.scale.js"></script>
+ <script src="effects.all.js"></script>
+ <script type="text/javascript" charset="utf-8">
+ jQuery(function( $ ) {
+ var test = $( "#testBox" ),
+ opts = $( ".arg" ),
+ optsRev = $( opts.get().reverse() ),
+ doer = $( "#doAnim" ),
+ current = $( "#current" ),
+ cleanStyle = test[0].style,
+ total = 1;
+
+ opts.each(function() {
+ total *= this.options.length;
+ });
+
+ opts.change( doAnim );
+ doer.click( doAnim );
+ $( "#cyclePrev" ).click(function() {
+ cycle( -1 );
+ });
+ $( "#cycleNext" ).click(function() {
+ cycle( 1 );
+ });
+
+ function cycle( direction ) {
+ optsRev.each(function() {
+ var cur = this.selectedIndex,
+ next = cur + direction,
+ len = this.options.length;
+
+ this.selectedIndex = ( next + len ) % len;
+
+ if ( ( next+len ) % len === next ) return false;
+ });
+ doAnim();
+ }
+
+
+ function doAnim() {
+ var cur = 0;
+ opts.each(function() {
+ cur *= this.options.length
+ cur += this.selectedIndex;
+ });
+ cur++;
+ current.text( "Configuration: " + cur + " of " + total );
+ run.apply(test, opts.map(function() {
+ return $(this).val();
+ }).get());
+ }
+
+ function run( position, v, h, vo, ho ) {
+ var el = this,
+ style = el[0].style,
+ effect = {
+ effect: "scale",
+ mode: "effect",
+ percent: 200,
+ origin: [ vo, ho ],
+ duration: 500
+ };
+ el.stop(true, true);
+ if ( typeof style === "object" ) {
+ style.cssText = "";
+ } else {
+ el[0].style = "";
+ }
+ el.css( "position", position )
+ .css( h, 5 )
+ .css( v, 5 )
+ .delay( 100 )
+ .effect( effect );
+ }
+ });
+ </script>
+ <style type="text/css">
+ #testArea {
+/* border: 5px dashed #777;*/
+ width: 200px;
+ height: 200px;
+ position: relative;
+ }
+ #testBox {
+ width: 50px;
+ height: 50px;
+ background-color: #bada55;
+ color: black;
+ border: 10px solid #fff;
+ margin: 10px;
+ padding: 10px;
+ }
+ label {
+ display: block;
+ }
+ #controls {
+ position: absolute;
+ z-index: 300;
+ left: 50%;
+ top: 50%;
+ margin-left: -200px;
+ width: 400px;
+ opacity: 0.8;
+ }
+ </style>
+</head>
+<body>
+ <div id="testArea">
+ <div id="testBox">
+ </div>
+ </div>
+ <div id="controls">
+ <label for="pos">Positioning
+ <select id="pos" class="arg">
+ <option value="absolute">absolute</option>
+ <option value="relative">relative</option>
+ <option value="fixed">fixed</option>
+ </select>
+ </label>
+ <label for="vertPos">Vertical Positioning
+ <select id="vertPos" class="arg">
+ <option value="top">top</option>
+ <option value="bottom">bottom</option>
+ </select>
+ </label>
+ <label for="horizPos">Horizontal Positioning
+ <select id="horizPos" class="arg">
+ <option value="left">left</option>
+ <option value="right">right</option>
+ </select>
+ </label>
+ <label for="vertOrigin">Vertical Origin
+ <select id="vertOrigin" class="arg">
+ <option value="top">top</option>
+ <option value="middle">middle</option>
+ <option value="bottom">bottom</option>
+ </select>
+ </label>
+ <label for="horizOrigin">Horizontal Origin
+ <select id="horizOrigin" class="arg">
+ <option value="left">left</option>
+ <option value="center">center</option>
+ <option value="right">right</option>
+ </select>
+ </label><br />
+ <label id="current">jQuery UI Scale Animation Test</label>
+ <button id="cyclePrev">Back</button>
+ <button id="doAnim">Run Animation</button>
+ <button id="cycleNext">Forward</button>
+ </div>
+</body> \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html
new file mode 100644
index 0000000..a2ae9e8
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html
@@ -0,0 +1,266 @@
+<!doctype html>
+<html>
+<head>
+ <title>Menu Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ $.fn.themeswitcher && $('<div/>').css({
+ position: "absolute",
+ right: 10,
+ top: 10
+ }).appendTo(document.body).themeswitcher();
+
+ $.widget("ui.drilldown", {
+ _init: function() {
+ var self = this;
+ this.active = this.element.find(">ul").attr("tabindex", 0);
+
+ // hide submenus and create indicator icons
+ this.element.find("ul").hide().prev("a").prepend('<span class="ui-icon ui-icon-carat-1-e"></span>').end().filter(":first").show();
+
+ this.element.find("ul").menu({
+ // disable built-in key handling
+ input: $(),
+ focus: function(event, ui) {
+ self.activeItem = ui.item;
+ },
+ select: function(event, ui) {
+ if (this != self.active[0]) {
+ return;
+ }
+ var nested = $(">ul", ui.item);
+ if (nested.length) {
+ self._open(nested);
+ } else {
+ self.element.find("h3").text(ui.item.text());
+ self.options.select.apply(this, arguments);
+ }
+ }
+ });
+
+ this.back = this.element.children(":last").button({
+ icons: {
+ primary: "ui-icon-carat-1-w"
+ }
+ }).click(function() {
+ self.up();
+ return false;
+ }).hide();
+ },
+
+ _open: function(submenu) {
+ this.active = submenu.show().css({
+ opacity: 0
+ }).position({
+ my: "left top",
+ at: "right top",
+ of: this.widget()
+ }).position({
+ my: "left top",
+ at: "left top",
+ of: this.widget(),
+ using: function(to) {
+ $(this).animate({
+ left: to.left,
+ top: to.top,
+ opacity: 1
+ });
+ }
+ });
+ this.back.show();
+ },
+
+ up: function() {
+ if (this.active.parent()[0] == this.element[0]) {
+ return;
+ }
+ this.active.position({
+ my: "left top",
+ at: "right top",
+ of: this.widget(),
+ using: function(to) {
+ $(this).animate({
+ left: to.left,
+ top: to.top,
+ opacity: 0
+ });
+ }
+ });
+ this.active = this.active.parent().parent().show();
+ this.activeItem = this.active.data("menu").active;
+ if (!this.active.parent().parent().is(":ui-menu")) {
+ this.back.hide();
+ }
+ },
+
+ down: function(event) {
+ var nested = this.activeItem.find(">ul");
+ if (nested.length) {
+ this._open(nested);
+ nested.menu("focus", event, nested.children(":first"))
+ }
+ },
+
+ show: function() {
+ },
+
+ hide: function() {
+ },
+
+ widget: function() {
+ return this.element.find(">ul");
+ }
+ });
+
+ var drilldown = $("#drilldown").drilldown({
+ select: function(event, ui) {
+ $("#log").append("<div>Selected " + ui.item.text() + "</div>");
+ }
+ });
+
+ drilldown.drilldown("widget").keydown(function(event) {
+ var menu = drilldown.data("drilldown").active.data("menu");
+ if (menu.widget().is(":hidden"))
+ return;
+ event.stopPropagation();
+ switch (event.keyCode) {
+ case $.ui.keyCode.PAGE_UP:
+ menu.previousPage();
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ menu.nextPage();
+ break;
+ case $.ui.keyCode.UP:
+ menu.previous();
+ break;
+ case $.ui.keyCode.LEFT:
+ drilldown.drilldown("up");
+ break;
+ case $.ui.keyCode.RIGHT:
+ drilldown.drilldown("down");
+ break;
+ case $.ui.keyCode.DOWN:
+ menu.next();
+ event.preventDefault();
+ break;
+ case $.ui.keyCode.ENTER:
+ case $.ui.keyCode.TAB:
+ menu.select();
+ drilldown.drilldown("hide");
+ event.preventDefault();
+ break;
+ case $.ui.keyCode.ESCAPE:
+ drilldown.drilldown("hide", event);
+ break;
+ default:
+ clearTimeout(menu.filterTimer);
+ var prev = menu.previousFilter || "";
+ var character = String.fromCharCode(event.keyCode);
+ var skip = false;
+ if (character == prev) {
+ skip = true;
+ } else {
+ character = prev + character;
+ }
+
+ var match = menu.widget().children("li").filter(function() {
+ return new RegExp("^" + character, "i").test($("a", this).text());
+ });
+ var match = skip && match.index(menu.active.next()) != -1 ? match.next() : match;
+ if (!match.length) {
+ character = String.fromCharCode(event.keyCode);
+ match = menu.widget().children("li").filter(function() {
+ return new RegExp("^" + character, "i").test($(this).text());
+ });
+ }
+ if (match.length) {
+ menu.focus(event, match);
+ if (match.length > 1) {
+ menu.previousFilter = character;
+ menu.filterTimer = setTimeout(function() {
+ delete menu.previousFilter;
+ }, 1000);
+ } else {
+ delete menu.previousFilter;
+ }
+ } else {
+ delete menu.previousFilter;
+ }
+ }
+ });
+ });
+ </script>
+ <style>
+ body { font-size:62.5%; }
+ .ui-menu { width: 200px; height: 170px; }
+ .ui-menu .ui-menu { position: absolute; }
+ .ui-menu .ui-icon { float: right; }
+ </style>
+</head>
+<body>
+
+<div id="drilldown">
+ <h3>Make a selection...</h3>
+ <ul>
+ <li>
+ <a href="#">Amsterdam</a>
+ <ul>
+ <li><a href="#">Aberdeen</a></li>
+ <li><a href="#">Ada</a></li>
+ <li>
+ <a href="#">Adamsville</a>
+ <ul>
+ <li><a href="#">Anaheim</a></li>
+ <li>
+ <a href="#">Cologne</a>
+ <ul>
+ <li><a href="#">Mberdeen</a></li>
+ <li><a href="#">Mda</a></li>
+ <li><a href="#">Mdamsville</a></li>
+ <li><a href="#">Mddyston</a></li>
+ <li><a href="#">Mmesville</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Frankfurt</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Addyston</a></li>
+ <li><a href="#">Amesville</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Anaheim</a></li>
+ <li><a href="#">Cologne</a></li>
+ <li><a href="#">Frankfurt</a></li>
+ <li>
+ <a href="#">Magdeburg</a>
+ <ul>
+ <li><a href="#">Mberdeen</a></li>
+ <li><a href="#">Mda</a></li>
+ <li><a href="#">Mdamsville</a></li>
+ <li><a href="#">Mddyston</a></li>
+ <li><a href="#">Mmesville</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Munich</a></li>
+ <li><a href="#">Utrecht</a></li>
+ <li><a href="#">Zurich</a></li>
+ </ul>
+ <a href="#">Go back</a>
+</div>
+
+<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
+ Log:
+ <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html
new file mode 100644
index 0000000..50837f4
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html
@@ -0,0 +1,283 @@
+<!doctype html>
+<html>
+<head>
+ <title>Menu Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $.fn.themeswitcher && $('<div/>').css({
+ position: "absolute",
+ right: 10,
+ top: 10
+ }).appendTo(document.body).themeswitcher();
+
+ function create() {
+ menus.menu({
+ select: function(event, ui) {
+ $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+ }
+ });
+
+ $("#menu5").menu({
+ select: function(event, ui) {
+ $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+ },
+ items: "div"
+ });
+
+ $("#menu6").menu({
+ select: function(event, ui) {
+ $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+ },
+ items: ".menuElement"
+ });
+ }
+
+ var menus = $("#menu1, #menu2, #menu3, .menu4");
+ create();
+
+ $("#toggle-destroy").toggle(function() {
+ menus.menu("destroy");
+ }, create);
+ $("#toggle-disable").toggle(function() {
+ menus.menu("disable");
+ }, function() {
+ menus.menu("enable");
+ });
+ });
+ </script>
+ <style>
+ body { font-size:62.5%; }
+ .ui-menu { width: 200px; margin-bottom: 2em; }
+ .menu4 { height: 200px; overflow-y: auto; overflow-x: hidden; }
+ .address-item { border-bottom: 1px solid #999; }
+ .address-header { display: block; margin-bottom: .2em; font-weight: bold; }
+ .address-content { display: block; margin-bottom: .2em; padding-left: 10px; }
+ </style>
+</head>
+<body>
+
+<ul id="menu1">
+ <li><a href="#">Aberdeen</a></li>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Adamsville</a></li>
+ <li><a href="#">Addyston</a></li>
+ <li><a href="#">Delphi</a></li>
+ <li><a href="#">Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+</ul>
+
+<ul id="menu2">
+ <li><a href="#">Aberdeen</a></li>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Adamsville</a></li>
+ <li><a href="#">Addyston</a></li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Saarland</a></li>
+ <li>
+ <a href="#">Salzburg</a>
+ <ul>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Perch</a></li>
+ </ul>
+ </li>
+</ul>
+
+<ul id="menu3">
+ <li><a href="#"><span class="ui-icon ui-icon-print"></span>Aberdeen</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-scissors"></span>Ada</a></li>
+ <li><a href="#">Adamsville</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-wrench"></span>Addyston</a></li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-wrench"></span>Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Saarland</a></li>
+ <li>
+ <a href="#"><span class="ui-icon ui-icon-print"></span>Salzburg</a>
+ <ul>
+ <li>
+ <a href="#"><span class="ui-icon ui-icon-wrench"></span>Delphi</a>
+ <ul>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Saarland</a></li>
+ <li><a href="#">Salzburg</a></li>
+ </ul>
+ </li>
+ <li>
+ <a href="#">Delphi</a>
+ <ul>
+ <li><a href="#"><span class="ui-icon ui-icon-wrench"></span>Ada</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-wrench"></span>Saarland</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-wrench"></span>Salzburg</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Perch</a></li>
+ </ul>
+ </li>
+</ul>
+
+<ul class="menu4">
+ <li><a href="#">Aberdeen</a></li>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Adamsville</a></li>
+ <li><a href="#">Addyston</a></li>
+ <li><a href="#">Adelphi</a></li>
+ <li><a href="#">Adena</a></li>
+ <li><a href="#">Adrian</a></li>
+ <li><a href="#">Akron</a></li>
+ <li><a href="#">Albany</a></li>
+ <li><a href="#">Alexandria</a></li>
+ <li><a href="#">Alger</a></li>
+ <li><a href="#">Alledonia</a></li>
+ <li><a href="#">Alliance</a></li>
+ <li><a href="#">Alpha</a></li>
+ <li><a href="#">Alvada</a></li>
+ <li><a href="#">Alvordton</a></li>
+ <li><a href="#">Amanda</a></li>
+ <li><a href="#">Amelia</a></li>
+ <li><a href="#">Amesville</a></li>
+ <li><a href="#">Aberdeen</a></li>
+ <li><a href="#">Ada</a></li>
+ <li><a href="#">Adamsville</a></li>
+ <li><a href="#">Addyston</a></li>
+ <li><a href="#">Adelphi</a></li>
+ <li><a href="#">Adena</a></li>
+ <li><a href="#">Adrian</a></li>
+ <li><a href="#">Akron</a></li>
+ <li><a href="#">Albany</a></li>
+ <li><a href="#">Alexandria</a></li>
+ <li><a href="#">Alger</a></li>
+ <li><a href="#">Alledonia</a></li>
+ <li><a href="#">Alliance</a></li>
+ <li><a href="#">Alpha</a></li>
+ <li><a href="#">Alvada</a></li>
+ <li><a href="#">Alvordton</a></li>
+ <li><a href="#">Amanda</a></li>
+ <li><a href="#">Amelia</a></li>
+ <li><a href="#">Amesville</a></li>
+</ul>
+
+<div id="menu5">
+ <blockquote><a href="#">Aberdeen</a></blockquote>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Adamsville</a></blockquote>
+ <blockquote><a href="#">Addyston</a></blockquote>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote>
+ <a href="#">Salzburg</a>
+ <div>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote>
+ <a href="#">Delphi</a>
+ <div>
+ <blockquote><a href="#">Ada</a></blockquote>
+ <blockquote><a href="#">Saarland</a></blockquote>
+ <blockquote><a href="#">Salzburg</a></blockquote>
+ </div>
+ </blockquote>
+ <blockquote><a href="#">Perch</a></blockquote>
+ </div>
+ </blockquote>
+</div>
+
+<div class="menuElement" id="menu6">
+ <div class="address-item">
+ <a href="#">
+ <span class="address-header">John Doe</span>
+ <span class="address-content">78 West Main St Apt 3A</span>
+ <span class="address-content">Bloomsburg, PA 12345</span>
+ </a>
+ </div>
+ <div class="address-item">
+ <a href="#">
+ <span class="address-header">Jane Doe</span>
+ <span class="address-content">78 West Main St Apt 3A</span>
+ <span class="address-content">Bloomsburg, PA 12345</span>
+ </a>
+ </div>
+ <div class="address-item">
+ <a href="#">
+ <span class="address-header">James Doe</span>
+ <span class="address-content">78 West Main St Apt 3A</span>
+ <span class="address-content">Bloomsburg, PA 12345</span>
+ </a>
+ </div>
+ <div class="address-item">
+ <a href="#">
+ <span class="address-header">Jenny Doe</span>
+ <span class="address-content">78 West Main St Apt 3A</span>
+ <span class="address-content">Bloomsburg, PA 12345</span>
+ </a>
+ </div>
+ <div class="address-item">
+ <a href="#">
+ <span class="address-header">John Doe</span>
+ <span class="address-content">78 West Main St Apt 3A</span>
+ <span class="address-content">Bloomsburg, PA 12345</span>
+ </a>
+ <div class="menuElement">
+ <div><a href="#">Ada</a></div>
+ <div><a href="#">Saarland</a></div>
+ <div><a href="#">Salzburg</a></div>
+ </div>
+ </div>
+</div>
+
+<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
+ Log:
+ <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
+</div>
+
+<button id="toggle-disable">Disable / Enable</button>
+<button id="toggle-destroy">Destroy / Create</button>
+
+</body>
+</html> \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html
new file mode 100644
index 0000000..bce64bf
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html
@@ -0,0 +1,67 @@
+<!doctype html>
+<html>
+<head>
+ <title>Menu Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ var table = $("table");
+ var colgroup = table.find("colgroup");
+ var menu = $("<ul>").insertAfter(table);
+ var thead = table.find("thead");
+ thead.children("tr").addClass("ui-state-default");
+ var rows = table.find("tbody tr");
+ $("<table>").width("100%").append(colgroup.clone()).append(thead).wrap("<li>").parent().appendTo(menu);
+ rows.each(function() {
+ $("<table>").width("100%").append(colgroup.clone()).append(this).wrap("<li><a></a></li>").parent().parent().appendTo(menu);
+ });
+
+ menu.menu({
+ select: function(event, ui) {
+ $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+ }
+ });
+ });
+ </script>
+ <style>
+ body { font-size:62.5%; }
+ .ui-menu { width: 200px; }
+ </style>
+</head>
+<body>
+
+<table>
+ <colgroup><col style="width: 50%"><col style="width: 50%"></colgroup>
+ <thead>
+ <tr>
+ <th>Firstname</th>
+ <th>Lastname</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Scott</td>
+ <td>Gonzo</td>
+ </tr>
+ <tr>
+ <td>Richy</td>
+ <td>Worth</td>
+ </tr>
+ </tbody>
+</table>
+
+<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
+ Log:
+ <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
+</div>
+
+<button id="toggle-disable">Disable / Enable</button>
+<button id="toggle-destroy">Destroy / Create</button>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html
new file mode 100644
index 0000000..9d29abe
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ var inputs = $("input");
+ $("ul").insertAfter(inputs);
+ $(window).resize(function() {
+ inputs.each(function() {
+ $(this).position({
+ my: this.id.replace(/-/, " "),
+ at: this.id.replace(/-/, " "),
+ of: "#container",
+ collision: "none"
+ });
+ $(this).next().menu().position({
+ my: "left top",
+ at: "left bottom",
+ of: this
+ });
+ });
+ }).resize();
+ });
+ </script>
+ <style>
+ input, .ui-menu { position: absolute; }
+ .ui-menu { width: 200px; }
+ html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
+ #container { width: 95%; height: 95%; border: 1px solid black; margin: auto; }
+ </style>
+</head>
+<body>
+
+<div id="container"></div>
+
+<input id="left-top" />
+<input id="left-center" />
+<input id="left-bottom" />
+<input id="center-top" />
+<input id="center-center" />
+<input id="center-bottom" />
+<input id="right-top" />
+<input id="right-center" />
+<input id="right-bottom" />
+
+<ul>
+ <li><a href="#">Java</a></li>
+ <li><a href="#">JavaScript</a></li>
+ <li><a href="#">Perl</a></li>
+ <li><a href="#">Ruby</a></li>
+ <li><a href="#">C++</a></li>
+ <li><a href="#">Python</a></li>
+ <li><a href="#">C#</a></li>
+</ul>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html
new file mode 100644
index 0000000..78751d3
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html
@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: Fit</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ var inputs = $("input");
+ $("ul").insertAfter(inputs);
+ inputs.each(function(index) {
+ $(this).position({
+ my: this.id.replace(/-/, " "),
+ at: this.id.replace(/-/, " "),
+ of: "#container"+index,
+ collision: "none"
+ });
+ if(index < 3) {
+ $(this).next().menu().position({
+ my: "left top",
+ at: "left bottom",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ if(index >= 3 && index < 6) {
+ $(this).next().menu().position({
+ my: "right top",
+ at: "right bottom",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ if(index >= 6 && index < 9) {
+ $(this).next().menu().position({
+ my: "center top",
+ at: "center bottom",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ if(index >= 9 && index < 12) {
+ $(this).next().menu().position({
+ my: "left top",
+ at: "left bottom",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ if(index >= 12 && index < 15) {
+ $(this).next().menu().position({
+ my: "center center",
+ at: "center center",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ if(index >= 15) {
+ $(this).next().menu().position({
+ my: "left bottom",
+ at: "left top",
+ of: this,
+ within: "#container"+index,
+ collision: "fit"
+ });
+ }
+ });
+ });
+ </script>
+ <style>
+ input, .ui-menu { position: absolute; }
+ .ui-menu { width: 300px; }
+ #ui-menu-9, #ui-menu-10, #ui-menu-11, #ui-menu-12, #ui-menu-13, #ui-menu-14, #ui-menu-15, #ui-menu-16, #ui-menu-17 { width: auto; }
+ html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
+ .container { width: 200px; height: 200px; border: 1px solid black; display:inline-block; margin-left: 230px; margin-top: 15px; margin-bottom: 135px; }
+ .container2 { width: 200px; height: 100px; border: 1px solid black; display:inline-block; margin-left: 230px; margin-top: 15px; margin-bottom: 135px; }
+ </style>
+</head>
+<body>
+
+<div id="container0" class="container"></div>
+<div id="container1" class="container"></div>
+<div id="container2" class="container"></div>
+<div style="clear:both;"></div>
+<div id="container3" class="container"></div>
+<div id="container4" class="container"></div>
+<div id="container5" class="container"></div>
+<div style="clear:both;"></div>
+<div id="container6" class="container"></div>
+<div id="container7" class="container"></div>
+<div id="container8" class="container"></div>
+<div style="clear:both;"></div>
+<div id="container9" class="container2"></div>
+<div id="container10" class="container2"></div>
+<div id="container11" class="container2"></div>
+<div style="clear:both;"></div>
+<div id="container12" class="container2"></div>
+<div id="container13" class="container2"></div>
+<div id="container14" class="container2"></div>
+<div style="clear:both;"></div>
+<div id="container15" class="container2"></div>
+<div id="container16" class="container2"></div>
+<div id="container17" class="container2"></div>
+
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+
+<input id="left-top" />
+<input id="center-center" />
+<input id="right-bottom" />
+<input id="left-top" />
+<input id="center-center" />
+<input id="right-bottom" />
+<input id="left-top" />
+<input id="center-center" />
+<input id="right-bottom" />
+
+<ul>
+ <li><a href="#">Java</a></li>
+ <li><a href="#">JavaScript</a></li>
+ <li><a href="#">Perl</a></li>
+ <li><a href="#">Ruby</a></li>
+ <li><a href="#">C++</a></li>
+ <li><a href="#">Python</a></li>
+ <li><a href="#">C#</a></li>
+</ul>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html
new file mode 100644
index 0000000..7b26f6a
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: Flip</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ var inputs = $("input");
+ $("ul").insertAfter(inputs);
+ inputs.each(function(index) {
+ $(this).position({
+ my: this.id.replace(/-/, " "),
+ at: this.id.replace(/-/, " "),
+ of: "#container"+index,
+ collision: "none"
+ });
+ $(this).next().menu().position({
+ my: "left top",
+ at: "left bottom",
+ of: this,
+ within: "#container"+index
+ });
+ });
+ });
+ </script>
+ <style>
+ input, .ui-menu { position: absolute; }
+ .ui-menu { width: 300px; }
+ #ui-menu-6, #ui-menu-7, #ui-menu-8 { width: auto; }
+ html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
+ .container { width: 200px; height: 200px; border: 1px solid black; display:inline-block; margin-left: 230px; margin-top: 150px; }
+ </style>
+</head>
+<body>
+
+<div id="container0" class="container"></div>
+<div id="container1" class="container"></div>
+<div id="container2" class="container"></div><br>
+<div style="clear:both;"></div>
+<div id="container3" class="container" style="width:300px;"></div>
+<div id="container4" class="container" style="width:300px;"></div>
+<div id="container5" class="container" style="width:300px;"></div>
+<div style="clear:both;"></div>
+<div id="container6" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container7" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container8" class="container" style="height:100px; margin-bottom: 500px;"></div>
+
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-center" />
+<input id="center-center" />
+<input id="right-center" />
+<input id="left-bottom" />
+<input id="center-center" />
+<input id="right-bottom" />
+
+<ul>
+ <li><a href="#">Java</a></li>
+ <li><a href="#">JavaScript</a></li>
+ <li><a href="#">Perl</a></li>
+ <li><a href="#">Ruby</a></li>
+ <li><a href="#">C++</a></li>
+ <li><a href="#">Python</a></li>
+ <li><a href="#">C#</a></li>
+</ul>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html
new file mode 100644
index 0000000..b5cf829
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: FlipFit</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ var inputs = $("input");
+ $("ul").insertAfter(inputs);
+ inputs.each(function(index) {
+ $(this).position({
+ my: this.id.replace(/-/, " "),
+ at: this.id.replace(/-/, " "),
+ of: "#container"+index,
+ collision: "none"
+ });
+ $(this).next().menu().position({
+ my: index > 2 && index < 6 ? "right top" : "left top",
+ at: index > 2 && index < 6 ? "right bottom" : "left bottom",
+ of: this,
+ within: "#container"+index,
+ collision: "flipfit"
+ });
+ });
+ });
+ </script>
+ <style>
+ input, .ui-menu { position: absolute; }
+ .ui-menu { width: 300px; }
+ #ui-menu-3, #ui-menu-4, #ui-menu-5 { width: 185px; }
+ #ui-menu-9, #ui-menu-10, #ui-menu-11 { width: auto; }
+ html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
+ .container { width: 200px; height: 200px; border: 1px solid black; display:inline-block; margin-left: 230px; margin-top: 150px; }
+ </style>
+</head>
+<body>
+
+<div id="container0" class="container"></div>
+<div id="container1" class="container"></div>
+<div id="container2" class="container"></div><br>
+<div style="clear:both;"></div>
+<div id="container3" class="container"></div>
+<div id="container4" class="container"></div>
+<div id="container5" class="container"></div><br>
+<div style="clear:both;"></div>
+<div id="container6" class="container" style="width:300px;"></div>
+<div id="container7" class="container" style="width:300px;"></div>
+<div id="container8" class="container" style="width:300px;"></div>
+<div style="clear:both;"></div>
+<div id="container9" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container10" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container11" class="container" style="height:100px; margin-bottom: 500px;"></div>
+
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-center" />
+<input id="center-center" />
+<input id="right-center" />
+<input id="left-bottom" />
+<input id="center-center" />
+<input id="right-bottom" />
+
+<ul>
+ <li><a href="#">Java</a></li>
+ <li><a href="#">JavaScript</a></li>
+ <li><a href="#">Perl</a></li>
+ <li><a href="#">Ruby</a></li>
+ <li><a href="#">C++</a></li>
+ <li><a href="#">Python</a></li>
+ <li><a href="#">C#</a></li>
+</ul>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html
new file mode 100644
index 0000000..52b8008
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ $( "#elem" ).position({
+ my: "right bottom",
+ at: "right bottom",
+ of: window,
+ collision: "fit"
+ });
+ });
+ </script>
+ <style>
+ #elem {
+ position: absolute;
+ top: 100px;
+ left: 100px;
+ width: 200px;
+ height: 200px;
+ box-shadow: 10px 10px 5px #888;
+ -moz-box-shadow: 10px 10px 5px #888;
+ -webkit-box-shadow: 10px 10px 5px #888;
+ background-color: #aaa;
+ margin: 15px;
+ }
+ </style>
+</head>
+<body>
+
+<div id="elem"></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html
new file mode 100644
index 0000000..156c82e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html
@@ -0,0 +1,200 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Position Visual Test: Containing Element</title>
+
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
+
+ <script src="../../../jquery-1.7.1.js"></script>
+ <script src="../../../ui/jquery.ui.core.js"></script>
+ <script src="../../../ui/jquery.ui.widget.js"></script>
+ <script src="../../../ui/jquery.ui.mouse.js"></script>
+ <script src="../../../ui/jquery.ui.draggable.js"></script>
+ <script src="../../../ui/jquery.ui.position.js"></script>
+
+ <style>
+ html, body {
+ height:100%;
+ width:100%;
+ margin:0;
+ /* force scroll bar*/
+ min-height:800px;
+ min-width:800px;
+
+ /* IE6 needs this */
+ text-align:center;
+ }
+ .demo-description {
+ text-align:center;
+ padding:1.5em;
+ }
+ .demo-container {
+ background:#aaa;
+ width:80%;
+ height:80%;
+
+ text-align:left;
+ margin:0 auto;
+ position:relative;
+ padding:10px;
+ }
+ .demo {
+ background:#eee;
+ overflow:hidden;
+ position:relative;
+ height:100%;
+ /* IE6 needs this */
+ width:100%;
+ }
+ #parent {
+ width: 60%;
+ margin: 10px auto;
+ padding: 5px;
+ border: 1px solid #777;
+ background-color: #fbca93;
+ text-align: center;
+ cursor:move;
+ }
+ .positionable {
+ width: 75px;
+ height: 75px;
+ position: absolute;
+ display: block;
+ right: 0;
+ bottom: 0;
+ background-color: #bcd5e6;
+ text-align: center;
+ cursor:move;
+ }
+ .ui-flipped-top {
+ border-top: 3px solid #000000;
+ }
+ .ui-flipped-bottom {
+ border-bottom: 3px solid #000000;
+ }
+ .ui-flipped-left {
+ border-left: 3px solid #000000;
+ }
+ .ui-flipped-right {
+ border-right: 3px solid #000000;
+ }
+ select, input {
+ margin-left: 15px;
+ }
+ </style>
+ <script>
+ $(function() {
+ function position( using ) {
+ $( ".positionable" ).position({
+ of: $( "#parent" ),
+ my: $( "#my_horizontal" ).val() + " " + $( "#my_vertical" ).val(),
+ at: $( "#at_horizontal" ).val() + " " + $( "#at_vertical" ).val(),
+ offset: $( "#offset" ).val(),
+ using: using,
+ within: $( ".demo" ),
+ collision: $( "#collision_horizontal" ).val() + " " + $( "#collision_vertical" ).val()
+ });
+ }
+ $( ".demo" ).append("<div style='width:5000px;height:5000px;' />").css("overflow","auto");
+
+ $( ".positionable" ).css( "opacity", 0.5 );
+
+ $( ":input" ).bind( "click keyup change", function() { position(); } );
+
+ $( "#parent" ).draggable({
+ drag: function() { position(); }
+ });
+
+ $( ".positionable" ).draggable({
+ drag: function( event, ui ) {
+ // reset offset before calculating it
+ $( "#offset" ).val( "0" );
+ position(function( result ) {
+ var demo = $( ".demo" );
+ $( "#offset" ).val( "" + ( ui.offset.left - result.left - demo.offset().left + demo.scrollLeft() ) +
+ " " + ( ui.offset.top - result.top - demo.offset().top + demo.scrollTop() ) );
+ position();
+ });
+ }
+ });
+
+ position();
+ });
+ </script>
+</head>
+<body>
+
+<div class="demo-description">
+ Use the form controls to configure the positioning, or drag the positioned element to modify its offset.
+ <br/>Drag around the parent element to see collision detection in action.
+</div><!-- End demo-description -->
+
+<div class="demo-container">
+<div class="demo">
+
+ <div id="parent">
+ <p>This is the position parent element.</p>
+ </div>
+
+ <div class="positionable">
+ <p>to position</p>
+ </div>
+
+ <div class="positionable" style="width:120px; height: 40px;">
+ <p>to position 2</p>
+ </div>
+
+ <div style="padding: 20px; margin-top: 75px;">
+ position...
+ <div style="padding-bottom: 20px;">
+ <b>my:</b>
+ <select id="my_horizontal">
+ <option value="left">left</option>
+ <option value="center">center</option>
+ <option value="right" selected="selected">right</option>
+ </select>
+ <select id="my_vertical">
+ <option value="top">top</option>
+ <option value="middle">center</option>
+ <option value="bottom">bottom</option>
+ </select>
+ </div>
+ <div style="padding-bottom: 20px;">
+ <b>at:</b>
+ <select id="at_horizontal">
+ <option value="left">left</option>
+ <option value="center">center</option>
+ <option value="right" selected="selected">right</option>
+ </select>
+ <select id="at_vertical">
+ <option value="top">top</option>
+ <option value="middle">center</option>
+ <option value="bottom">bottom</option>
+ </select>
+ </div>
+ <div style="padding-bottom: 20px;">
+ <b>offset:</b>
+ <input id="offset" type="text" size="15"/>
+ </div>
+ <div style="padding-bottom: 20px;">
+ <b>collision:</b>
+ <select id="collision_horizontal">
+ <option value="flip">flip</option>
+ <option value="fit">fit</option>
+ <option value="none">none</option>
+ </select>
+ <select id="collision_vertical">
+ <option value="flip">flip</option>
+ <option value="fit">fit</option>
+ <option value="none">none</option>
+ </select>
+ </div>
+ </div>
+
+</div><!-- End demo -->
+</div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html
new file mode 100644
index 0000000..131cc41
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html
@@ -0,0 +1,532 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>jQuery UI Example Page</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.accordion.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.datepicker.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.dialog.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.droppable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.progressbar.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.resizable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.selectable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.sortable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.tabs.js"></script>
+ <script type="text/javascript">
+ $(function(){
+
+ // Accordion
+ $(".accordion").accordion({ header: "h3" });
+ $(".accordion").last().accordion("option", "icons", false);
+
+
+ // Tabs
+ $('#tabs').tabs();
+
+
+ // Dialog
+ $('#dialog').dialog({
+ autoOpen: false,
+ width: 600,
+ buttons: {
+ "Ok": function() {
+ $(this).dialog("close");
+ },
+ "Cancel": function() {
+ $(this).dialog("close");
+ }
+ }
+ });
+
+ // Dialog Link
+ $('#dialog_link').click(function(){
+ $('#dialog').dialog('open');
+ return false;
+ });
+
+ // Datepicker
+ $('#datepicker').datepicker({
+ inline: true,
+ showWeek: true
+ });
+
+ $('#multidatepicker').datepicker({
+ numberOfMonths: 3,
+ showButtonPanel: true,
+ inline: true
+ });
+
+ // Slider
+ $('.slider').slider({
+ range: true,
+ values: [17, 67]
+ });
+
+ $("#eq > span").each(function() {
+ var value = parseInt($(this).text());
+ $(this).empty().slider({
+ value: value,
+ range: "min",
+ animate: true,
+ orientation: "vertical"
+ });
+ });
+
+
+ // Progressbar
+ $("#progressbar").progressbar({
+ value: 20
+ });
+
+ //hover states on the static widgets
+ $('#dialog_link, ul#icons li').hover(
+ function() { $(this).addClass('ui-state-hover'); },
+ function() { $(this).removeClass('ui-state-hover'); }
+ );
+
+ $(".buttonset > button").button()
+ .next()
+ .button({
+ text: false,
+ icons: {
+ primary: "ui-icon-triangle-1-s"
+ }
+ })
+ .parent()
+ .buttonset();
+
+
+ $('#beginning').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-seek-start'
+ }
+ });
+ $('#rewind').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-seek-prev'
+ }
+ });
+ $('#play').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-play'
+ }
+ });
+ $('#stop').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-stop'
+ }
+ });
+ $('#forward').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-seek-next'
+ }
+ });
+ $('#end').button({
+ text: false,
+ icons: {
+ primary: 'ui-icon-seek-end'
+ }
+ });
+ $("#shuffle").button();
+ $("#repeat").buttonset();
+
+ });
+ </script>
+ <style type="text/css">
+ /*demo page css*/
+ body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px;}
+ .demoHeaders { margin-top: 2em; clear:both; }
+ #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
+ #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
+ ul#icons {margin: 0; padding: 0;}
+ ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
+ ul#icons span.ui-icon {float: left; margin: 0 4px;}
+ .columnbox { height: 150px; width: 48%; float:left; margin-right: 1%; }
+ #eq span { height:120px; float:left; margin:15px }
+ .buttonset {margin-bottom: 5px; }
+ #toolbar { padding: 10px 4px; }
+ </style>
+ </head>
+ <body>
+
+ <!-- <p style="font-size: 1.3em; line-height: 1.5; margin: 1em 0; width: 50%;">This page demonstrates the widgets using a theme.</p> -->
+ <div id="switcher" style="position:absolute; right: 20px; top: 20px;"></div>
+
+ <!-- Accordion -->
+ <h2 class="demoHeaders">Accordion</h2>
+ <div class="columnbox">
+ <div class="accordion">
+ <div>
+ <h3><a href="#">First</a></h3>
+ <div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
+ </div>
+ <div>
+ <h3><a href="#">Second</a></h3>
+ <div>Phasellus mattis tincidunt nibh.</div>
+ </div>
+ <div>
+ <h3><a href="#">Third</a></h3>
+ <div>Nam dui erat, auctor a, dignissim quis.</div>
+ </div>
+ </div>
+ </div>
+ <div class="columnbox">
+ <div class="accordion">
+ <div>
+ <h3><a href="#">First no icons</a></h3>
+ <div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
+ </div>
+ <div>
+ <h3><a href="#">Second no icons</a></h3>
+ <div>Phasellus mattis tincidunt nibh.</div>
+ </div>
+ <div>
+ <h3><a href="#">Third no icons</a></h3>
+ <div>Nam dui erat, auctor a, dignissim quis.</div>
+ </div>
+ </div>
+ </div>
+
+
+ <!-- Tabs -->
+ <h2 class="demoHeaders">Tabs</h2>
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ <li><a href="#tabs-3">Third</a></li>
+ </ul>
+ <div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
+ <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
+ <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
+ </div>
+
+ <!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->
+ <h2 class="demoHeaders">Dialog</h2>
+ <p><a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p>
+
+ <div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" ><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title">Inline Dialog</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" ><span class="ui-icon ui-icon-closethick" >close</span></a></div><div class="ui-dialog-content ui-widget-content" >
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div><div class="ui-resizable-handle ui-resizable-n" ></div><div class="ui-resizable-handle ui-resizable-e" ></div><div class="ui-resizable-handle ui-resizable-s" ></div><div class="ui-resizable-handle ui-resizable-w" ></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" ></div><div class="ui-resizable-handle ui-resizable-sw" ></div><div class="ui-resizable-handle ui-resizable-ne" ></div><div class="ui-resizable-handle ui-resizable-nw" ></div><div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Ok</span></button><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Cancel</span></button></div></div>
+
+
+ <h2 class="demoHeaders">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>
+ <div style="position: relative; width: 96%; height: 200px; padding:1% 4%; overflow:hidden;" class="fakewindowcontain">
+ <p>Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. </p><p>Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. </p><p>Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. </p><p>Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. </p>
+
+ <!-- ui-dialog -->
+ <div class="ui-overlay"><div class="ui-widget-overlay"></div><div class="ui-widget-shadow ui-corner-all" style="width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;"></div></div>
+ <div style="position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;" class="ui-widget ui-widget-content ui-corner-all">
+ <div class="ui-dialog-content ui-widget-content" style="background: none; border: 0;">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- ui-dialog -->
+ <div id="dialog" title="Dialog Title">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+
+
+
+ <h2 class="demoHeaders">Framework Icons (content color preview)</h2>
+ <ul id="icons" class="ui-widget ui-helper-clearfix">
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-w"><span class="ui-icon ui-icon-carat-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-nw"><span class="ui-icon ui-icon-carat-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-n-s"><span class="ui-icon ui-icon-carat-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li>
+
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li>
+ </ul>
+
+
+ <!-- Slider -->
+ <h2 class="demoHeaders">Slider</h2>
+ <div class="columnbox">
+ <div class="slider"></div>
+ </div>
+ <div class="columnbox">
+ <div id="eq">
+ <span>88</span>
+ <span>77</span>
+ <span>55</span>
+ <span>33</span>
+ <span>40</span>
+ <span>45</span>
+ <span>70</span>
+ </div>
+ </div>
+
+
+ <!-- Datepicker -->
+ <h2 class="demoHeaders">Datepicker</h2>
+ <div class="columnbox" style="width: 32%">
+ <div id="datepicker"></div>
+ </div>
+ <div class="columnbox" style="width: 66%; height: 220px;">
+ <div id="multidatepicker"></div>
+ </div>
+
+
+ <!-- Progressbar -->
+ <h2 class="demoHeaders">Progressbar</h2>
+ <div id="progressbar"></div>
+
+ <!-- Highlight / Error -->
+ <h2 class="demoHeaders">Highlight / Error</h2>
+ <div class="ui-widget">
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
+ <strong>Hey!</strong> Sample ui-state-highlight style.</p>
+ </div>
+ </div>
+ <br/>
+ <div class="ui-widget">
+ <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
+ <strong>Alert:</strong> Sample ui-state-error style.</p>
+ </div>
+ </div>
+
+ <h2 class="demoHeaders">Button</h2>
+
+ <div class="buttonset">
+ <button id="rerun">Run last action</button>
+ <button id="select">Select an action</button>
+ </div>
+
+ <span id="toolbar" class="ui-widget-header ui-corner-all">
+ <button id="beginning">go to beginning</button>
+ <button id="rewind">rewind</button>
+ <button id="play">play</button>
+ <button id="stop">stop</button>
+ <button id="forward">fast forward</button>
+ <button id="end">go to end</button>
+
+ <input type="checkbox" id="shuffle" /><label for="shuffle">Shuffle</label>
+
+ <span id="repeat">
+ <input type="radio" id="repeat0" name="repeat" checked="checked" /><label for="repeat0">No Repeat</label>
+ <input type="radio" id="repeat1" name="repeat" /><label for="repeat1">Once</label>
+ <input type="radio" id="repeatall" name="repeat" /><label for="repeatall">All</label>
+ </span>
+ </span>
+
+ <!-- theme switcher -->
+
+ <script src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script>
+ $('#switcher').themeswitcher();
+ </script>
+
+
+
+ </body>
+</html>
+
+
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php
new file mode 100644
index 0000000..a689a73
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php
@@ -0,0 +1,2 @@
+<?php sleep(1); ?>
+<strong>Hello</strong> world! \ No newline at end of file
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html
new file mode 100644
index 0000000..993fbbd
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Tooltip Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.effects.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.effects.blind.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.effects.bounce.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.effects.drop.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.effects.explode.js"></script>
+ <!--
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ -->
+ <script type="text/javascript">
+ $(function() {
+ var animations = [{}, {
+ show: {
+ effect: "slideDown"
+ },
+ hide: {
+ effect: "slideUp"
+ }
+ }, {
+ show: {
+ effect: "explode"
+ },
+ hide: {
+ effect: "explode"
+ }
+ }, {
+ show: {
+ effect: "bounce"
+ },
+ hide: {
+ effect: "blind"
+ }
+ },
+ {
+ show: {
+ effect: "drop",
+ direction: "right"
+ },
+ hide: {
+ effect: "drop",
+ direction: "right"
+ }
+ }];
+ $.each(animations, function(index, animation) {
+ var text = JSON.stringify(animation);
+ $("<span></span>").attr("title", text).text(text).tooltip({
+ show: animation.show,
+ hide: animation.hide
+ }).wrap("<li></li>").parent().appendTo("ul");
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div style="width:300px">
+ <ul class="ui-widget ui-widget-header">
+ </ul>
+</div>
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html
new file mode 100644
index 0000000..79d8d32
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html
@@ -0,0 +1,213 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Tooltip Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
+ <script type="text/javascript">
+ $.widget("ui.callout", {
+ _init: function() {
+ this.element.append('<div class="ui-tooltip-pointer ui-widget-content"><div class="ui-tooltip-pointer-inner" style="border-right-color:rgb(255, 255, 255)"></div></div>');
+ },
+ pointAt: function(target) {
+ target = $(target);
+ var tx = target.offset().left + target.width() / 2,
+ ty = target.offset().top + target.height() / 2,
+ dx = this.element.offset().left + this.element.width() / 2,
+ dy = this.element.offset().top + this.element.height() / 2;
+ function d(a, b) {
+ return a > b ? a - b : b - a;
+ }
+ this.element.attr("class", this.element.attr("class").replace(/(.+)ui-tooltip-arrow-..(.+)?/, "$1 $2"));
+ if (dx < tx && d(dx, tx) > d(dy, tx)) {
+ this.element.addClass("ui-tooltip-arrow-rc");
+ }
+ if (dx > tx && d(dx, tx) > d(dy, ty)) {
+ this.element.addClass("ui-tooltip-arrow-lc");
+ }
+ if (dy > ty && d(dx, tx) < d(dy, ty)) {
+ this.element.addClass("ui-tooltip-arrow-tc");
+ }
+ if (dy < ty && d(dx, tx) < d(dy, ty)) {
+ this.element.addClass("ui-tooltip-arrow-bc");
+ }
+
+ // fix inner borders
+ $('.ui-tooltip-pointer-inner', this.element).each(function(){
+ var pt = $(this).parent().parent();
+ var bColor = pt.css('backgroundColor');
+ $(this).css({
+ borderLeftColor: '',
+ borderRightColor: '',
+ borderTopColor: '',
+ borderBottomColor: ''
+ });
+ if(pt.is('.ui-tooltip-arrow-rb,.ui-tooltip-arrow-rc,.ui-tooltip-arrow-rt')){ $(this).css('border-left-color', bColor); }
+ else if(pt.is('.ui-tooltip-arrow-br,.ui-tooltip-arrow-bc,.ui-tooltip-arrow-bl')){ $(this).css('border-top-color', bColor); }
+ else if(pt.is('.ui-tooltip-arrow-lb,.ui-tooltip-arrow-lc,.ui-tooltip-arrow-lt')){ $(this).css('border-right-color', bColor); }
+ else { $(this).css('border-bottom-color', bColor); }
+ });
+ }
+ });
+
+ $(function() {
+ $.ui.tooltip.prototype.options.show = function(event, ui) {
+ $(this).tooltip("widget").callout("pointAt", ui.target);
+ }
+
+ function enable() {
+ // default
+ $("#context1, form input").tooltip();
+
+ // custom class, replaces ui-widget-content
+ $("#context2").tooltip({
+ tooltipClass: "ui-widget-header"
+ });
+ $("#right1").tooltip({
+ tooltipClass: "ui-state-error"
+ });
+
+ // synchronous content
+ $("#see-footnote").tooltip({
+ content: function() {
+ return $($(this).attr("href")).html();
+ }
+ });
+ // asynchronous content
+ $("#ajax").tooltip({
+ content: function(response) {
+ $.get("ajaxcontent.html", response);
+ }
+ });
+
+ // custom position
+ $("#right2").tooltip({
+ position: {
+ my: "center top",
+ at: "center bottom",
+ offset: "0 10"
+ },
+ tooltipClass: "ui-state-highlight"
+ });
+
+ $(".ui-tooltip").callout();
+ }
+ enable();
+
+ $("#disable").toggle(function() {
+ $("*").tooltip("disable");
+ }, function() {
+ $("*").tooltip("enable");
+ });
+ $("#toggle").toggle(function() {
+ $("*").tooltip("destroy");
+ }, function() {
+ enable();
+ });
+ });
+ </script>
+
+ <style>
+ .ui-tooltip .ui-tooltip-pointer,.ui-tooltip .ui-tooltip-pointer-inner { position:absolute; width:0; height:0; background:none; }
+
+ /*top*/
+ .ui-tooltip-arrow-tr .ui-tooltip-pointer,.ui-tooltip-arrow-tc .ui-tooltip-pointer,.ui-tooltip-arrow-tl .ui-tooltip-pointer { top:-14px; border-top:0; border-bottom-width:14px; }
+ .ui-tooltip-arrow-tr .ui-tooltip-pointer { border-left:18px dotted transparent; border-right:0; right:10px; }
+ .ui-tooltip-arrow-tc .ui-tooltip-pointer { border-left:10px dotted transparent; border-right:10px dotted transparent; left:50%; margin-left:-10px; }
+ .ui-tooltip-arrow-tl .ui-tooltip-pointer { border-left:0; border-right:18px dotted transparent; left:10px; }
+ .ui-tooltip-arrow-tr .ui-tooltip-pointer-inner,.ui-tooltip-arrow-tc .ui-tooltip-pointer-inner,.ui-tooltip-arrow-tl .ui-tooltip-pointer-inner { border-bottom:10px solid #fff; bottom:-14px; }
+ .ui-tooltip-arrow-tr .ui-tooltip-pointer-inner { border-left:12px dotted transparent; border-right:0; right:2px; }
+ .ui-tooltip-arrow-tc .ui-tooltip-pointer-inner { border-left:8px dotted transparent; border-right:8px dotted transparent; left:-8px; }
+ .ui-tooltip-arrow-tl .ui-tooltip-pointer-inner { border-left:0; border-right:12px dotted transparent; left:2px; }
+
+ /*right*/
+ .ui-tooltip-arrow-rb .ui-tooltip-pointer,.ui-tooltip-arrow-rc .ui-tooltip-pointer,.ui-tooltip-arrow-rt .ui-tooltip-pointer { right:-14px; border-right:0; border-left-width:14px; }
+ .ui-tooltip-arrow-rb .ui-tooltip-pointer { border-bottom:0; border-top:18px dotted transparent; bottom:10px; }
+ .ui-tooltip-arrow-rc .ui-tooltip-pointer { border-bottom:10px dotted transparent; border-top:10px dotted transparent; bottom:50%; margin-bottom:-10px; }
+ .ui-tooltip-arrow-rt .ui-tooltip-pointer { border-bottom:18px dotted transparent; border-top:0; top:10px; }
+ .ui-tooltip-arrow-rb .ui-tooltip-pointer-inner,.ui-tooltip-arrow-rc .ui-tooltip-pointer-inner,.ui-tooltip-arrow-rt .ui-tooltip-pointer-inner { border-left:10px solid #fff; left:-14px; }
+ .ui-tooltip-arrow-rb .ui-tooltip-pointer-inner { border-bottom:0; border-top:12px dotted transparent; bottom:2px; }
+ .ui-tooltip-arrow-rc .ui-tooltip-pointer-inner { border-bottom:8px dotted transparent; border-top:8px dotted transparent; bottom:-8px; }
+ .ui-tooltip-arrow-rt .ui-tooltip-pointer-inner { border-bottom:12px dotted transparent; border-top:0; top:2px; }
+
+ /*bottom*/
+ .ui-tooltip-arrow-br .ui-tooltip-pointer,.ui-tooltip-arrow-bc .ui-tooltip-pointer,.ui-tooltip-arrow-bl .ui-tooltip-pointer { bottom:-14px; border-bottom:0; border-top-width:14px; }
+ .ui-tooltip-arrow-br .ui-tooltip-pointer { border-left:18px dotted transparent; border-right:0; right:10px; }
+ .ui-tooltip-arrow-bc .ui-tooltip-pointer { border-left:10px dotted transparent; border-right:10px dotted transparent; left:50%; margin-left:-10px; }
+ .ui-tooltip-arrow-bl .ui-tooltip-pointer { border-left:0; border-right:18px dotted transparent; left:10px; }
+ .ui-tooltip-arrow-br .ui-tooltip-pointer-inner,.ui-tooltip-arrow-bc .ui-tooltip-pointer-inner,.ui-tooltip-arrow-bl .ui-tooltip-pointer-inner { border-top:10px solid #fff; top:-14px; }
+ .ui-tooltip-arrow-br .ui-tooltip-pointer-inner { border-left:12px dotted transparent; border-right:0; right:2px; }
+ .ui-tooltip-arrow-bc .ui-tooltip-pointer-inner { border-left:8px dotted transparent; border-right:8px dotted transparent; left:-8px; }
+ .ui-tooltip-arrow-bl .ui-tooltip-pointer-inner { border-left:0; border-right:12px dotted transparent; left:2px; }
+
+ /*left*/
+ .ui-tooltip-arrow-lb .ui-tooltip-pointer,.ui-tooltip-arrow-lc .ui-tooltip-pointer,.ui-tooltip-arrow-lt .ui-tooltip-pointer { left:-14px; border-left:0; border-right-width:14px; }
+ .ui-tooltip-arrow-lb .ui-tooltip-pointer { border-bottom:0; border-top:18px dotted transparent; bottom:10px; }
+ .ui-tooltip-arrow-lc .ui-tooltip-pointer { border-bottom:10px dotted transparent; border-top:10px dotted transparent; bottom:50%; margin-bottom:-10px; }
+ .ui-tooltip-arrow-lt .ui-tooltip-pointer { border-bottom:18px dotted transparent; border-top:0; top:10px; }
+ .ui-tooltip-arrow-lb .ui-tooltip-pointer-inner,.ui-tooltip-arrow-lc .ui-tooltip-pointer-inner,.ui-tooltip-arrow-lt .ui-tooltip-pointer-inner { border-right:10px solid #fff; right:-14px; }
+ .ui-tooltip-arrow-lb .ui-tooltip-pointer-inner { border-bottom:0; border-top:12px dotted transparent; bottom:2px; }
+ .ui-tooltip-arrow-lc .ui-tooltip-pointer-inner { border-bottom:8px dotted transparent; border-top:8px dotted transparent; bottom:-8px; }
+ </style>
+</head>
+<body>
+
+<div style="width:300px">
+ <ul id="context1" class="ui-widget ui-widget-header">
+ <li><a href="#" title="Tooltip text 1">Anchor 1</a></li>
+ <li><a href="#" title="Tooltip text 2">Anchor 2</a></li>
+ <li><a href="#" title="Tooltip text 3">Anchor 3</a></li>
+ <li><a href="#" title="Tooltip text 4 more Tooltip text Tooltip text ">Anchor 4</a></li>
+ <li><a href="#" title="Tooltip text 5 more Tooltip text Tooltip text ">Anchor 5</a></li>
+ <li><a href="#" title="Tooltip text 6 more Tooltip text Tooltip text ">Anchor 6</a></li>
+ </ul>
+
+ <div id="right1" style="position: absolute; right: 1em" title="right aligned element">
+ collision detection should kick in around here
+ </div>
+
+ <div style="margin: 2em 0">
+ <a id="see-footnote" href="#footnote">I'm a link to a footnote.</a>
+ </div>
+
+ <div id="right2" style="position: absolute; right: 1em" title="right aligned element with custom position">
+ right aligned with custom position
+ </div>
+
+ <div id="ajax" style="width: 100px;" class="ui-widget-content" title="never be seen">
+ gets its content via ajax
+ </div>
+
+ <div id="context2" class="ui-widget ui-widget-content">
+ <span title="something" style="border:1px solid blue">span</span>
+ <div title="something else" style="border:1px solid red;">
+ div
+ <span title="something more" style="border:1px solid green;">nested span</span>
+ </div>
+ </div>
+
+ <form style="margin: 2em 0;">
+ <div>
+ <label for="first">First Name:</label>
+ <input id="first" title="Your first name is optional" />
+ </div>
+ <div>
+ <label for="last">Last Name:</label>
+ <input id="last" title="Your last name is optional" />
+ </div>
+ </form>
+
+ <div id="footnote">This is <strong>the</strong> footnote, including other elements</div>
+
+ <button id="disable">Toggle disabled</button>
+ <button id="toggle">Toggle widget</button>
+</div>
+
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html
new file mode 100644
index 0000000..b282a73
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html
@@ -0,0 +1,186 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Tooltip Visual Test: Default</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.7.1.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
+ <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
+ <!--
+ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ -->
+ <script type="text/javascript">
+ $(function() {
+ $.fn.themeswitcher && $('<div/>').css({
+ position: "absolute",
+ right: 10,
+ top: 10
+ }).appendTo(document.body).themeswitcher();
+
+ function enable() {
+ // default
+ $("#context1, form, #childish").tooltip();
+
+ // custom class, replaces ui-widget-content
+ $("#context2").tooltip({
+ tooltipClass: "ui-widget-header"
+ });
+ $("#right1").tooltip({
+ tooltipClass: "ui-state-error"
+ });
+
+ // synchronous content
+ $("#footnotes").tooltip({
+ items: "[href^='#']",
+ content: function() {
+ return $($(this).attr("href")).html();
+ }
+ });
+ // asynchronous content
+ $("#ajax").tooltip({
+ content: function(response) {
+ $.get("ajaxcontent.php", response);
+ return "Loading...";
+ }
+ });
+ // asynchronous content with caching
+ var content;
+ $("#ajax2").tooltip({
+ content: function(response) {
+ if (content) {
+ return content;
+ }
+ $.ajax({
+ url: "ajaxcontent.php",
+ cache: false,
+ success: function(result) {
+ content = result;
+ response(result);
+ }
+ });
+ return "Loading...";
+ }
+ });
+
+ // custom position
+ $("#right2").tooltip({
+ tooltipClass: "ui-state-highlight",
+ position: {
+ my: "center top",
+ at: "center bottom",
+ offset: "0 10"
+ }
+ });
+
+ $("#button1").button();
+ $("#button2").button({
+ icons: {
+ primary: "ui-icon-wrench"
+ }
+ });
+ $("#button3, #button4").button({
+ icons: {
+ primary: "ui-icon-wrench"
+ },
+ text: false
+ });
+ $("#buttons").tooltip({
+ position: {
+ my: "center bottom",
+ at: "center top",
+ offset: "0 -5"
+ }
+ });
+ }
+ enable();
+
+ $("#disable").toggle(function() {
+ $(":ui-tooltip").tooltip("disable");
+ }, function() {
+ $(":ui-tooltip").tooltip("enable");
+ });
+ $("#toggle").toggle(function() {
+ $(":ui-tooltip").tooltip("destroy");
+ }, function() {
+ enable();
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div style="width:300px">
+ <ul id="context1" class="ui-widget ui-widget-header">
+ <li><a href="#" title="Tooltip text 1">Anchor 1</a></li>
+ <li><a href="#" title="Tooltip text 2">Anchor 2</a></li>
+ <li><a href="#" title="Tooltip text 3">Anchor 3</a></li>
+ <li><a href="#" title="Tooltip text 4 more Tooltip text Tooltip text ">Anchor 4</a></li>
+ <li><a href="#" title="Tooltip text 5 more Tooltip text Tooltip text ">Anchor 5</a></li>
+ <li><a href="#" title="Tooltip text 6 more Tooltip text Tooltip text ">Anchor 6</a></li>
+ </ul>
+
+ <div id="right1" style="position: absolute; right: 1em" title="right aligned element">
+ collision detection should kick in around here
+ </div>
+
+ <div id="footnotes" style="margin: 2em 0">
+ <a href="#footnote1">I'm a link to a footnote.</a>
+ <a href="#footnote2">I'm another link to a footnote.</a>
+ </div>
+
+ <div id="right2" style="position: absolute; right: 1em" title="right aligned element with custom position">
+ right aligned with custom position
+ </div>
+
+ <div id="ajax" style="width: 100px;" class="ui-widget-content" title="never be seen">
+ gets its content via ajax
+ </div>
+ <div id="ajax2" style="width: 100px;" class="ui-widget-content" title="never be seen">
+ gets its content via ajax, caches the response
+ </div>
+
+ <div id="context2" class="ui-widget ui-widget-content">
+ <span title="something" style="border:1px solid blue">span</span>
+ <div title="something else" style="border:1px solid red;">
+ div
+ <span title="something more" style="border:1px solid green;">nested span</span>
+ </div>
+ </div>
+
+ <div id="childish" class="ui-widget ui-widget-content" style="margin: 2em 0; border: 1px solid black;" title="element with child elements">
+ Text in <strong>bold</strong>.
+ </div>
+
+ <form style="margin: 2em 0;">
+ <div>
+ <label for="first">First Name:</label>
+ <input id="first" title="Your first name is optional" />
+ </div>
+ <div>
+ <label for="last">Last Name:</label>
+ <input id="last" title="Your last name is optional" />
+ </div>
+ </form>
+
+ <div id="buttons">
+ <button id="button1" title="Button Tooltip">Button Label</button>
+ <button id="button2" title="Icon Button">Button with Icon</button>
+ <button id="button3">Icon Only Button 1</button>
+ <button id="button4">Icon Only Button 2</button>
+ </div>
+
+ <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div>
+ <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div>
+
+ <button id="disable">Toggle disabled</button>
+ <button id="toggle">Toggle widget</button>
+</div>
+
+<div style="height: 2000px"></div>
+
+</body>
+</html>
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css b/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css
new file mode 100644
index 0000000..b61fc0e
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css
@@ -0,0 +1,3 @@
+body { font-size: 62.5%; }
+#draggable, #resizable { width: 100px; height: 100px; background: #abc; }
+#droppable { width: 100px; height: 100px; background: #cde; }